home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-09-15 | 215.3 KB | [ONLN/HLX2] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Sep 15 07:00:00 1994, modified Thu Sep 15 07:00:00 1994, creator 'HLX2', type 'ONLN', 215247 bytes "MIDI Management Tools" , at 0x3494f 4885 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
100%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [ONLN] |
macFileCreator | [HLX2] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 15 4d 49 44 49 20 4d | 61 6e 61 67 65 6d 65 6e |..MIDI M|anagemen|
|00000010| 74 20 54 6f 6f 6c 73 00 | 00 00 00 00 00 00 00 00 |t Tools.|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 03 48 cf 00 | 00 13 15 aa 9d d9 b0 aa |.....H..|........|
|00000060| 9d d9 b0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 5f 49 00 00 |........|...._I..|
|00000080| f0 a8 09 4d 61 63 69 6e | 74 6f 73 68 a8 20 0d 4d |...Macin|tosh. .M|
|00000090| 49 44 49 20 4d 61 6e 61 | 67 65 6d 65 6e 74 20 54 |IDI Mana|gement T|
|000000a0| 6f 6f 6c 73 0d 44 65 76 | 65 6c 6f 70 65 72 20 4e |ools.Dev|eloper N|
|000000b0| 6f 74 65 73 0d 41 70 70 | 6c 65 20 44 65 76 65 6c |otes.App|le Devel|
|000000c0| 6f 70 65 72 20 50 72 6f | 64 75 63 74 73 0d a9 20 |oper Pro|ducts.. |
|000000d0| 41 70 70 6c 65 20 43 6f | 6d 70 75 74 65 72 2c 20 |Apple Co|mputer, |
|000000e0| 49 6e 63 2e 20 31 39 38 | 39 0d 0d 0d f0 20 41 70 |Inc. 198|9.... Ap|
|000000f0| 70 6c 65 20 43 6f 6d 70 | 75 74 65 72 2c 20 49 6e |ple Comp|uter, In|
|00000100| 63 2e 20 20 0d 54 68 69 | 73 20 6d 61 6e 75 61 6c |c. .Thi|s manual|
|00000110| 20 61 6e 64 20 74 68 65 | 20 73 6f 66 74 77 61 72 | and the| softwar|
|00000120| 65 20 64 65 73 63 72 69 | 62 65 64 20 69 6e 20 69 |e descri|bed in i|
|00000130| 74 20 61 72 65 20 63 6f | 70 79 72 69 67 68 74 65 |t are co|pyrighte|
|00000140| 64 2c 20 77 69 74 68 20 | 61 6c 6c 20 72 69 67 68 |d, with |all righ|
|00000150| 74 73 20 72 65 73 65 72 | 76 65 64 2e 20 55 6e 64 |ts reser|ved. Und|
|00000160| 65 72 20 74 68 65 20 63 | 6f 70 79 72 69 67 68 74 |er the c|opyright|
|00000170| 20 6c 61 77 73 2c 20 74 | 68 69 73 20 6d 61 6e 75 | laws, t|his manu|
|00000180| 61 6c 20 6f 72 20 74 68 | 65 20 73 6f 66 74 77 61 |al or th|e softwa|
|00000190| 72 65 20 6d 61 79 20 6e | 6f 74 20 62 65 20 63 6f |re may n|ot be co|
|000001a0| 70 69 65 64 2c 20 69 6e | 20 77 68 6f 6c 65 20 6f |pied, in| whole o|
|000001b0| 72 20 69 6e 20 70 61 72 | 74 2c 20 77 69 74 68 6f |r in par|t, witho|
|000001c0| 75 74 20 77 72 69 74 74 | 65 6e 20 63 6f 6e 73 65 |ut writt|en conse|
|000001d0| 6e 74 20 6f 66 20 41 70 | 70 6c 65 2c 20 65 78 63 |nt of Ap|ple, exc|
|000001e0| 65 70 74 20 69 6e 20 74 | 68 65 20 6e 6f 72 6d 61 |ept in t|he norma|
|000001f0| 6c 20 75 73 65 20 6f 66 | 20 74 68 65 20 73 6f 66 |l use of| the sof|
|00000200| 74 77 61 72 65 20 6f 72 | 20 74 6f 20 6d 61 6b 65 |tware or| to make|
|00000210| 20 61 20 62 61 63 6b 75 | 70 20 63 6f 70 79 20 6f | a backu|p copy o|
|00000220| 66 20 74 68 65 20 73 6f | 66 74 77 61 72 65 2e 20 |f the so|ftware. |
|00000230| 54 68 65 20 73 61 6d 65 | 20 70 72 6f 70 72 69 65 |The same| proprie|
|00000240| 74 61 72 79 20 61 6e 64 | 20 63 6f 70 79 72 69 67 |tary and| copyrig|
|00000250| 68 74 20 6e 6f 74 69 63 | 65 73 20 6d 75 73 74 20 |ht notic|es must |
|00000260| 62 65 20 61 66 66 69 78 | 65 64 20 74 6f 20 61 6e |be affix|ed to an|
|00000270| 79 20 70 65 72 6d 69 74 | 74 65 64 20 63 6f 70 69 |y permit|ted copi|
|00000280| 65 73 20 61 73 20 77 65 | 72 65 20 61 66 66 69 78 |es as we|re affix|
|00000290| 65 64 20 74 6f 20 74 68 | 65 20 6f 72 69 67 69 6e |ed to th|e origin|
|000002a0| 61 6c 2e 20 54 68 69 73 | 20 65 78 63 65 70 74 69 |al. This| excepti|
|000002b0| 6f 6e 20 64 6f 65 73 20 | 6e 6f 74 20 61 6c 6c 6f |on does |not allo|
|000002c0| 77 20 63 6f 70 69 65 73 | 20 74 6f 20 62 65 20 6d |w copies| to be m|
|000002d0| 61 64 65 20 66 6f 72 20 | 6f 74 68 65 72 73 2c 20 |ade for |others, |
|000002e0| 77 68 65 74 68 65 72 20 | 6f 72 20 6e 6f 74 20 73 |whether |or not s|
|000002f0| 6f 6c 64 2c 20 62 75 74 | 20 61 6c 6c 20 6f 66 20 |old, but| all of |
|00000300| 74 68 65 20 6d 61 74 65 | 72 69 61 6c 20 70 75 72 |the mate|rial pur|
|00000310| 63 68 61 73 65 64 20 28 | 77 69 74 68 20 61 6c 6c |chased (|with all|
|00000320| 20 62 61 63 6b 75 70 20 | 63 6f 70 69 65 73 29 20 | backup |copies) |
|00000330| 6d 61 79 20 62 65 20 73 | 6f 6c 64 2c 20 67 69 76 |may be s|old, giv|
|00000340| 65 6e 2c 20 6f 72 20 6c | 6f 61 6e 65 64 20 74 6f |en, or l|oaned to|
|00000350| 20 61 6e 6f 74 68 65 72 | 20 70 65 72 73 6f 6e 2e | another| person.|
|00000360| 20 55 6e 64 65 72 20 74 | 68 65 20 6c 61 77 2c 20 | Under t|he law, |
|00000370| 63 6f 70 79 69 6e 67 20 | 69 6e 63 6c 75 64 65 73 |copying |includes|
|00000380| 20 74 72 61 6e 73 6c 61 | 74 69 6e 67 20 69 6e 74 | transla|ting int|
|00000390| 6f 20 61 6e 6f 74 68 65 | 72 20 6c 61 6e 67 75 61 |o anothe|r langua|
|000003a0| 67 65 20 6f 72 20 66 6f | 72 6d 61 74 2e 20 20 0d |ge or fo|rmat. .|
|000003b0| 59 6f 75 20 6d 61 79 20 | 75 73 65 20 74 68 65 20 |You may |use the |
|000003c0| 73 6f 66 74 77 61 72 65 | 20 6f 6e 20 61 6e 79 20 |software| on any |
|000003d0| 63 6f 6d 70 75 74 65 72 | 20 6f 77 6e 65 64 20 62 |computer| owned b|
|000003e0| 79 20 79 6f 75 2c 20 62 | 75 74 20 65 78 74 72 61 |y you, b|ut extra|
|000003f0| 20 63 6f 70 69 65 73 20 | 63 61 6e 6e 6f 74 20 62 | copies |cannot b|
|00000400| 65 20 6d 61 64 65 20 66 | 6f 72 20 74 68 69 73 20 |e made f|or this |
|00000410| 70 75 72 70 6f 73 65 2e | 20 20 0d 54 68 65 20 41 |purpose.| .The A|
|00000420| 70 70 6c 65 20 6c 6f 67 | 6f 20 69 73 20 61 20 72 |pple log|o is a r|
|00000430| 65 67 69 73 74 65 72 65 | 64 20 74 72 61 64 65 6d |egistere|d tradem|
|00000440| 61 72 6b 20 6f 66 20 41 | 70 70 6c 65 20 43 6f 6d |ark of A|pple Com|
|00000450| 70 75 74 65 72 2c 20 49 | 6e 63 2e 20 55 73 65 20 |puter, I|nc. Use |
|00000460| 6f 66 20 74 68 65 20 d2 | 6b 65 79 62 6f 61 72 64 |of the .|keyboard|
|00000470| d3 20 6c 6f 67 6f 20 28 | 4f 70 74 69 6f 6e 2d 53 |. logo (|Option-S|
|00000480| 68 69 66 74 2d 4b 29 20 | 66 6f 72 20 63 6f 6d 6d |hift-K) |for comm|
|00000490| 65 72 63 69 61 6c 20 70 | 75 72 70 6f 73 65 73 20 |ercial p|urposes |
|000004a0| 77 69 74 68 6f 75 74 20 | 74 68 65 20 70 72 69 6f |without |the prio|
|000004b0| 72 20 77 72 69 74 74 65 | 6e 20 63 6f 6e 73 65 6e |r writte|n consen|
|000004c0| 74 20 6f 66 20 41 70 70 | 6c 65 20 6d 61 79 20 63 |t of App|le may c|
|000004d0| 6f 6e 73 74 69 74 75 74 | 65 20 74 72 61 64 65 6d |onstitut|e tradem|
|000004e0| 61 72 6b 20 69 6e 66 72 | 69 6e 67 65 6d 65 6e 74 |ark infr|ingement|
|000004f0| 20 61 6e 64 20 75 6e 66 | 61 69 72 20 63 6f 6d 70 | and unf|air comp|
|00000500| 65 74 69 74 69 6f 6e 20 | 69 6e 20 76 69 6f 6c 61 |etition |in viola|
|00000510| 74 69 6f 6e 20 6f 66 20 | 66 65 64 65 72 61 6c 20 |tion of |federal |
|00000520| 61 6e 64 20 73 74 61 74 | 65 20 6c 61 77 73 2e 0d |and stat|e laws..|
|00000530| a9 20 41 70 70 6c 65 20 | 43 6f 6d 70 75 74 65 72 |. Apple |Computer|
|00000540| 2c 20 49 6e 63 2e 2c 20 | 31 39 38 39 20 0d 32 30 |, Inc., |1989 .20|
|00000550| 35 32 35 20 4d 61 72 69 | 61 6e 69 20 41 76 65 6e |525 Mari|ani Aven|
|00000560| 75 65 20 20 0d 43 75 70 | 65 72 74 69 6e 6f 2c 20 |ue .Cup|ertino, |
|00000570| 43 41 20 20 39 35 30 31 | 34 20 20 0d 28 34 30 38 |CA 9501|4 .(408|
|00000580| 29 20 39 39 36 2d 31 30 | 31 30 20 20 0d 41 70 70 |) 996-10|10 .App|
|00000590| 6c 65 2c 20 74 68 65 20 | 41 70 70 6c 65 20 6c 6f |le, the |Apple lo|
|000005a0| 67 6f 2c 20 4c 61 73 65 | 72 57 72 69 74 65 72 2c |go, Lase|rWriter,|
|000005b0| 20 50 61 74 63 68 42 61 | 79 20 61 6e 64 20 4d 61 | PatchBa|y and Ma|
|000005c0| 63 69 6e 74 6f 73 68 20 | 61 72 65 20 72 65 67 69 |cintosh |are regi|
|000005d0| 73 74 65 72 65 64 20 74 | 72 61 64 65 6d 61 72 6b |stered t|rademark|
|000005e0| 73 20 6f 66 20 41 70 70 | 6c 65 20 43 6f 6d 70 75 |s of App|le Compu|
|000005f0| 74 65 72 2c 20 49 6e 63 | 2e 20 20 0d 49 54 43 20 |ter, Inc|. .ITC |
|00000600| 41 76 61 6e 74 20 47 61 | 72 64 65 20 47 6f 74 68 |Avant Ga|rde Goth|
|00000610| 69 63 2c 20 49 54 43 20 | 47 61 72 61 6d 6f 6e 64 |ic, ITC |Garamond|
|00000620| 2c 20 61 6e 64 20 49 54 | 43 20 5a 61 70 66 20 44 |, and IT|C Zapf D|
|00000630| 69 6e 67 62 61 74 73 20 | 61 72 65 20 72 65 67 69 |ingbats |are regi|
|00000640| 73 74 65 72 65 64 20 74 | 72 61 64 65 6d 61 72 6b |stered t|rademark|
|00000650| 73 20 6f 66 20 49 6e 74 | 65 72 6e 61 74 69 6f 6e |s of Int|ernation|
|00000660| 61 6c 20 54 79 70 65 66 | 61 63 65 20 43 6f 72 70 |al Typef|ace Corp|
|00000670| 6f 72 61 74 69 6f 6e 2e | 20 20 0d 4d 69 63 72 6f |oration.| .Micro|
|00000680| 73 6f 66 74 20 69 73 20 | 61 20 72 65 67 69 73 74 |soft is |a regist|
|00000690| 65 72 65 64 20 74 72 61 | 64 65 6d 61 72 6b 20 6f |ered tra|demark o|
|000006a0| 66 20 4d 69 63 72 6f 73 | 6f 66 74 20 43 6f 72 70 |f Micros|oft Corp|
|000006b0| 6f 72 61 74 69 6f 6e 2e | 20 20 0d 50 6f 73 74 53 |oration.| .PostS|
|000006c0| 63 72 69 70 74 20 69 73 | 20 61 20 72 65 67 69 73 |cript is| a regis|
|000006d0| 74 65 72 65 64 20 74 72 | 61 64 65 6d 61 72 6b 20 |tered tr|ademark |
|000006e0| 6f 66 20 41 64 6f 62 65 | 20 53 79 73 74 65 6d 73 |of Adobe| Systems|
|000006f0| 20 49 6e 63 6f 72 70 6f | 72 61 74 65 64 2e 20 20 | Incorpo|rated. |
|00000700| 0d 56 61 72 69 74 79 70 | 65 72 20 69 73 20 61 20 |.Varityp|er is a |
|00000710| 72 65 67 69 73 74 65 72 | 65 64 20 74 72 61 64 65 |register|ed trade|
|00000720| 6d 61 72 6b 2c 20 61 6e | 64 20 56 54 36 30 30 20 |mark, an|d VT600 |
|00000730| 69 73 20 61 20 74 72 61 | 64 65 6d 61 72 6b 2c 20 |is a tra|demark, |
|00000740| 6f 66 20 41 4d 20 49 6e | 74 65 72 6e 61 74 69 6f |of AM In|ternatio|
|00000750| 6e 61 6c 2c 20 49 6e 63 | 2e 20 20 0d 53 69 6d 75 |nal, Inc|. .Simu|
|00000760| 6c 74 61 6e 65 6f 75 73 | 6c 79 20 70 75 62 6c 69 |ltaneous|ly publi|
|00000770| 73 68 65 64 20 69 6e 20 | 74 68 65 20 55 6e 69 74 |shed in |the Unit|
|00000780| 65 64 20 53 74 61 74 65 | 73 20 61 6e 64 20 43 61 |ed State|s and Ca|
|00000790| 6e 61 64 61 2e 20 20 0d | 0d 0d 43 6f 6e 74 65 6e |nada. .|..Conten|
|000007a0| 74 73 0d 41 62 6f 75 74 | 20 74 68 69 73 20 64 6f |ts.About| this do|
|000007b0| 63 75 6d 65 6e 74 09 35 | 0d 41 62 6f 75 74 20 74 |cument.5|.About t|
|000007c0| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 09 |he MIDI |Manager.|
|000007d0| 35 0d 48 6f 77 20 54 68 | 65 20 4d 49 44 49 20 4d |5.How Th|e MIDI M|
|000007e0| 61 6e 61 67 65 72 20 77 | 6f 72 6b 73 09 35 0d 49 |anager w|orks.5.I|
|000007f0| 6e 73 74 61 6c 6c 69 6e | 67 20 74 68 65 20 4d 49 |nstallin|g the MI|
|00000800| 44 49 20 4d 61 6e 61 67 | 65 72 09 35 0d 53 69 67 |DI Manag|er.5.Sig|
|00000810| 6e 69 6e 67 20 69 6e 20 | 74 6f 20 74 68 65 20 4d |ning in |to the M|
|00000820| 49 44 49 20 4d 61 6e 61 | 67 65 72 09 36 0d 43 72 |IDI Mana|ger.6.Cr|
|00000830| 65 61 74 69 6e 67 20 70 | 6f 72 74 73 09 36 0d 49 |eating p|orts.6.I|
|00000840| 64 65 6e 74 69 66 69 65 | 72 73 20 61 6e 64 20 72 |dentifie|rs and r|
|00000850| 65 66 65 72 65 6e 63 65 | 20 6e 75 6d 62 65 72 73 |eference| numbers|
|00000860| 09 37 0d 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 20 |.7.MIDI |Manager |
|00000870| 70 61 63 6b 65 74 73 09 | 37 0d 52 65 61 64 69 6e |packets.|7.Readin|
|00000880| 67 20 4d 49 44 49 20 64 | 61 74 61 09 37 0d 57 72 |g MIDI d|ata.7.Wr|
|00000890| 69 74 69 6e 67 20 4d 49 | 44 49 20 64 61 74 61 09 |iting MI|DI data.|
|000008a0| 38 0d 54 69 6d 65 72 20 | 66 61 63 69 6c 69 74 69 |8.Timer |faciliti|
|000008b0| 65 73 09 31 30 0d 54 69 | 6d 65 72 20 66 6f 72 6d |es.10.Ti|mer form|
|000008c0| 61 74 73 09 31 30 0d 50 | 61 63 6b 65 74 20 68 61 |ats.10.P|acket ha|
|000008d0| 6e 64 6c 69 6e 67 09 31 | 31 0d 4c 65 6e 67 74 68 |ndling.1|1.Length|
|000008e0| 09 31 31 0d 41 70 70 6c | 69 63 61 74 69 6f 6e 73 |.11.Appl|ications|
|000008f0| 09 31 32 0d 4d 49 44 49 | 20 4d 61 6e 61 67 65 72 |.12.MIDI| Manager|
|00000900| 20 43 61 6c 6c 73 09 31 | 33 0d 53 6e 64 44 69 73 | Calls.1|3.SndDis|
|00000910| 70 56 65 72 73 69 6f 6e | 09 31 33 0d 4d 49 44 49 |pVersion|.13.MIDI|
|00000920| 53 69 67 6e 49 6e 09 31 | 33 0d 4d 49 44 49 53 69 |SignIn.1|3.MIDISi|
|00000930| 67 6e 4f 75 74 09 31 34 | 0d 4d 49 44 49 47 65 74 |gnOut.14|.MIDIGet|
|00000940| 43 6c 69 65 6e 74 73 09 | 31 34 0d 4d 49 44 49 47 |Clients.|14.MIDIG|
|00000950| 65 74 43 6c 69 65 6e 74 | 4e 61 6d 65 09 31 35 0d |etClient|Name.15.|
|00000960| 4d 49 44 49 53 65 74 43 | 6c 69 65 6e 74 4e 61 6d |MIDISetC|lientNam|
|00000970| 65 09 31 35 0d 4d 49 44 | 49 47 65 74 50 6f 72 74 |e.15.MID|IGetPort|
|00000980| 73 09 31 35 0d 4d 49 44 | 49 41 64 64 50 6f 72 74 |s.15.MID|IAddPort|
|00000990| 09 31 36 0d 4d 49 44 49 | 47 65 74 50 6f 72 74 49 |.16.MIDI|GetPortI|
|000009a0| 6e 66 6f 09 31 37 0d 4d | 49 44 49 43 6f 6e 6e 65 |nfo.17.M|IDIConne|
|000009b0| 63 74 44 61 74 61 09 31 | 38 0d 4d 49 44 49 55 6e |ctData.1|8.MIDIUn|
|000009c0| 43 6f 6e 6e 65 63 74 44 | 61 74 61 09 31 39 0d 4d |ConnectD|ata.19.M|
|000009d0| 49 44 49 43 6f 6e 6e 65 | 63 74 54 69 6d 65 09 31 |IDIConne|ctTime.1|
|000009e0| 39 0d 4d 49 44 49 55 6e | 43 6f 6e 6e 65 63 74 54 |9.MIDIUn|ConnectT|
|000009f0| 69 6d 65 09 32 30 0d 4d | 49 44 49 46 6c 75 73 68 |ime.20.M|IDIFlush|
|00000a00| 09 32 30 0d 4d 49 44 49 | 47 65 74 52 65 61 64 48 |.20.MIDI|GetReadH|
|00000a10| 6f 6f 6b 09 32 30 0d 4d | 49 44 49 53 65 74 52 65 |ook.20.M|IDISetRe|
|00000a20| 61 64 48 6f 6f 6b 09 32 | 30 0d 4d 49 44 49 47 65 |adHook.2|0.MIDIGe|
|00000a30| 74 50 6f 72 74 4e 61 6d | 65 09 32 32 0d 4d 49 44 |tPortNam|e.22.MID|
|00000a40| 49 53 65 74 50 6f 72 74 | 4e 61 6d 65 09 32 32 0d |ISetPort|Name.22.|
|00000a50| 4d 49 44 49 57 61 6b 65 | 55 70 09 32 32 0d 4d 49 |MIDIWake|Up.22.MI|
|00000a60| 44 49 52 65 6d 6f 76 65 | 50 6f 72 74 09 32 33 0d |DIRemove|Port.23.|
|00000a70| 4d 49 44 49 47 65 74 53 | 79 6e 63 09 32 33 0d 4d |MIDIGetS|ync.23.M|
|00000a80| 49 44 49 53 65 74 53 79 | 6e 63 09 32 34 0d 4d 49 |IDISetSy|nc.24.MI|
|00000a90| 44 49 47 65 74 43 75 72 | 54 69 6d 65 09 32 34 0d |DIGetCur|Time.24.|
|00000aa0| 4d 49 44 49 53 65 74 43 | 75 72 54 69 6d 65 09 32 |MIDISetC|urTime.2|
|00000ab0| 34 0d 4d 49 44 49 53 74 | 61 72 74 54 69 6d 65 09 |4.MIDISt|artTime.|
|00000ac0| 32 34 0d 4d 49 44 49 53 | 74 6f 70 54 69 6d 65 09 |24.MIDIS|topTime.|
|00000ad0| 32 35 0d 4d 49 44 49 47 | 65 74 4f 66 66 73 65 74 |25.MIDIG|etOffset|
|00000ae0| 54 69 6d 65 09 32 35 0d | 4d 49 44 49 53 65 74 4f |Time.25.|MIDISetO|
|00000af0| 66 66 73 65 74 54 69 6d | 65 09 32 35 0d 4d 49 44 |ffsetTim|e.25.MID|
|00000b00| 49 57 6f 72 6c 64 43 68 | 61 6e 67 65 64 09 32 35 |IWorldCh|anged.25|
|00000b10| 0d 4d 49 44 49 47 65 74 | 52 65 66 43 6f 6e 09 32 |.MIDIGet|RefCon.2|
|00000b20| 36 0d 4d 49 44 49 53 65 | 74 52 65 66 43 6f 6e 09 |6.MIDISe|tRefCon.|
|00000b30| 32 36 0d 4d 49 44 49 47 | 65 74 43 6c 52 65 66 43 |26.MIDIG|etClRefC|
|00000b40| 6f 6e 09 32 36 0d 4d 49 | 44 49 53 65 74 43 6c 52 |on.26.MI|DISetClR|
|00000b50| 65 66 43 6f 6e 09 32 36 | 0d 4d 49 44 49 47 65 74 |efCon.26|.MIDIGet|
|00000b60| 54 43 46 6f 72 6d 61 74 | 09 32 37 0d 4d 49 44 49 |TCFormat|.27.MIDI|
|00000b70| 53 65 74 54 43 46 6f 72 | 6d 61 74 09 32 37 0d 4d |SetTCFor|mat.27.M|
|00000b80| 49 44 49 43 6f 6e 76 65 | 72 74 54 69 6d 65 09 32 |IDIConve|rtTime.2|
|00000b90| 37 0d 4d 49 44 49 57 72 | 69 74 65 50 61 63 6b 65 |7.MIDIWr|itePacke|
|00000ba0| 74 09 32 38 0d 4d 49 44 | 49 50 6f 6c 6c 09 32 38 |t.28.MID|IPoll.28|
|00000bb0| 0d 4d 49 44 49 47 65 74 | 43 6c 69 65 6e 74 49 63 |.MIDIGet|ClientIc|
|00000bc0| 6f 6e 09 32 39 0d 4d 49 | 44 49 53 65 74 52 75 6e |on.29.MI|DISetRun|
|00000bd0| 52 61 74 65 09 32 39 0d | 53 75 6d 6d 61 72 79 20 |Rate.29.|Summary |
|00000be0| 6f 66 20 20 4d 49 44 49 | 20 4d 61 6e 61 67 65 72 |of MIDI| Manager|
|00000bf0| 20 64 61 74 61 20 73 74 | 72 75 63 74 75 72 65 73 | data st|ructures|
|00000c00| 09 33 30 0d 41 70 70 65 | 6e 64 69 78 20 41 20 2d |.30.Appe|ndix A -|
|00000c10| 20 54 68 65 20 41 70 70 | 6c 65 20 4d 49 44 49 20 | The App|le MIDI |
|00000c20| 44 72 69 76 65 72 09 33 | 34 0d 4d 49 44 49 20 49 |Driver.3|4.MIDI I|
|00000c30| 6e 70 75 74 09 33 34 0d | 54 69 6d 65 20 43 6f 64 |nput.34.|Time Cod|
|00000c40| 65 20 49 6e 70 75 74 09 | 33 35 0d 45 72 72 6f 72 |e Input.|35.Error|
|00000c50| 20 48 61 6e 64 6c 69 6e | 67 09 33 35 0d 4d 49 44 | Handlin|g.35.MID|
|00000c60| 49 20 4f 75 74 70 75 74 | 09 33 36 0d 54 69 6d 65 |I Output|.36.Time|
|00000c70| 20 43 6f 64 65 20 4f 75 | 74 70 75 74 09 33 37 0d | Code Ou|tput.37.|
|00000c80| 41 70 70 65 6e 64 69 78 | 20 42 20 2d 20 4d 49 44 |Appendix| B - MID|
|00000c90| 49 20 4d 61 6e 61 67 65 | 72 20 54 69 70 73 09 33 |I Manage|r Tips.3|
|00000ca0| 38 0d 41 75 74 6f 6d 61 | 74 69 63 20 43 6f 6e 6e |8.Automa|tic Conn|
|00000cb0| 65 63 74 69 6f 6e 73 09 | 33 38 0d 0d 41 62 6f 75 |ections.|38..Abou|
|00000cc0| 74 20 74 68 69 73 20 64 | 6f 63 75 6d 65 6e 74 0d |t this d|ocument.|
|00000cd0| 54 68 69 73 20 6d 61 6e | 75 61 6c 20 64 65 73 63 |This man|ual desc|
|00000ce0| 72 69 62 65 73 20 74 68 | 65 20 6f 70 65 72 61 74 |ribes th|e operat|
|00000cf0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 4d 61 63 69 6e |ion of t|he Macin|
|00000d00| 74 6f 73 68 a8 20 4d 49 | 44 49 20 4d 61 6e 61 67 |tosh. MI|DI Manag|
|00000d10| 65 72 20 61 6e 64 20 61 | 73 73 6f 63 69 61 74 65 |er and a|ssociate|
|00000d20| 64 20 74 6f 6f 6c 73 2e | 20 4e 6f 74 65 73 20 61 |d tools.| Notes a|
|00000d30| 6e 64 20 77 61 72 6e 69 | 6e 67 73 20 61 70 70 65 |nd warni|ngs appe|
|00000d40| 61 72 20 69 6e 20 62 6f | 6c 64 66 61 63 65 20 74 |ar in bo|ldface t|
|00000d50| 79 70 65 2e 20 46 72 61 | 67 6d 65 6e 74 73 20 6f |ype. Fra|gments o|
|00000d60| 66 20 70 72 6f 67 72 61 | 6d 20 63 6f 64 65 20 61 |f progra|m code a|
|00000d70| 6e 64 20 70 61 72 61 6d | 65 74 65 72 73 20 74 68 |nd param|eters th|
|00000d80| 61 74 20 61 72 65 20 6d | 65 61 6e 74 20 74 6f 20 |at are m|eant to |
|00000d90| 62 65 20 74 79 70 65 64 | 20 74 6f 20 79 6f 75 72 |be typed| to your|
|00000da0| 20 63 6f 6d 70 75 74 65 | 72 20 61 70 70 65 61 72 | compute|r appear|
|00000db0| 20 69 6e 20 74 68 65 20 | 43 6f 75 72 69 65 72 20 | in the |Courier |
|00000dc0| 74 79 70 65 66 61 63 65 | 2e 0d 41 62 6f 75 74 20 |typeface|..About |
|00000dd0| 74 68 65 20 4d 49 44 49 | 20 4d 61 6e 61 67 65 72 |the MIDI| Manager|
|00000de0| 0d 54 68 65 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 |.The MID|I Manage|
|00000df0| 72 20 54 6f 6f 6c 20 53 | 65 74 20 69 73 20 61 20 |r Tool S|et is a |
|00000e00| 73 6f 66 74 77 61 72 65 | 20 74 6f 6f 6c 6b 69 74 |software| toolkit|
|00000e10| 20 74 68 61 74 20 65 6e | 61 62 6c 65 73 20 64 65 | that en|ables de|
|00000e20| 76 65 6c 6f 70 65 72 73 | 20 74 6f 20 63 72 65 61 |velopers| to crea|
|00000e30| 74 65 20 70 6f 72 74 73 | 20 66 6f 72 20 4d 49 44 |te ports| for MID|
|00000e40| 49 20 64 61 74 61 2c 20 | 61 6e 64 20 74 6f 20 74 |I data, |and to t|
|00000e50| 72 61 6e 73 66 65 72 20 | 73 75 63 68 20 64 61 74 |ransfer |such dat|
|00000e60| 61 20 74 6f 20 61 6e 64 | 20 66 72 6f 6d 20 4d 49 |a to and| from MI|
|00000e70| 44 49 20 64 65 76 69 63 | 65 73 20 63 6f 6e 6e 65 |DI devic|es conne|
|00000e80| 63 74 65 64 20 74 6f 20 | 74 68 65 20 4d 61 63 69 |cted to |the Maci|
|00000e90| 6e 74 6f 73 68 2e 20 54 | 68 65 20 64 61 74 61 20 |ntosh. T|he data |
|00000ea0| 63 61 6e 20 62 65 20 70 | 61 73 73 65 64 20 61 6d |can be p|assed am|
|00000eb0| 6f 6e 67 20 73 65 76 65 | 72 61 6c 20 61 70 70 6c |ong seve|ral appl|
|00000ec0| 69 63 61 74 69 6f 6e 73 | 20 72 75 6e 6e 69 6e 67 |ications| running|
|00000ed0| 20 75 6e 64 65 72 20 4d | 75 6c 74 69 46 69 6e 64 | under M|ultiFind|
|00000ee0| 65 72 aa 2c 20 6f 72 20 | 62 65 74 77 65 65 6e 20 |er., or |between |
|00000ef0| 6c 6f 67 69 63 61 6c 20 | 70 6f 72 74 73 20 77 69 |logical |ports wi|
|00000f00| 74 68 69 6e 20 61 20 73 | 69 6e 67 6c 65 20 61 70 |thin a s|ingle ap|
|00000f10| 70 6c 69 63 61 74 69 6f | 6e 2e 0d 41 20 73 65 70 |plicatio|n..A sep|
|00000f20| 61 72 61 74 65 20 4d 49 | 44 49 20 64 72 69 76 65 |arate MI|DI drive|
|00000f30| 72 20 20 61 6c 6c 6f 77 | 73 20 74 68 65 20 4d 49 |r allow|s the MI|
|00000f40| 44 49 20 4d 61 6e 61 67 | 65 72 20 74 6f 20 72 65 |DI Manag|er to re|
|00000f50| 61 64 20 20 61 6e 64 20 | 77 72 69 74 65 20 4d 49 |ad and |write MI|
|00000f60| 44 49 20 64 61 74 61 20 | 74 6f 20 74 68 65 20 73 |DI data |to the s|
|00000f70| 65 72 69 61 6c 20 70 6f | 72 74 73 20 73 6f 20 74 |erial po|rts so t|
|00000f80| 68 61 74 20 79 6f 75 20 | 64 6f 6e d5 74 20 68 61 |hat you |don.t ha|
|00000f90| 76 65 20 74 6f 20 61 63 | 63 65 73 73 20 74 68 65 |ve to ac|cess the|
|00000fa0| 6d 20 79 6f 75 72 73 65 | 6c 66 2e 20 41 64 64 69 |m yourse|lf. Addi|
|00000fb0| 74 69 6f 6e 61 6c 20 4d | 49 44 49 20 64 72 69 76 |tional M|IDI driv|
|00000fc0| 65 72 73 20 63 61 6e 20 | 62 65 20 77 72 69 74 74 |ers can |be writt|
|00000fd0| 65 6e 20 74 6f 20 61 6c | 6c 6f 77 20 61 63 63 65 |en to al|low acce|
|00000fe0| 73 73 20 74 6f 20 6f 74 | 68 65 72 20 74 79 70 65 |ss to ot|her type|
|00000ff0| 73 20 6f 66 20 68 61 72 | 64 77 61 72 65 2e 20 54 |s of har|dware. T|
|00001000| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 20 |he MIDI |Manager |
|00001010| 61 73 73 69 67 6e 73 20 | 74 69 6d 65 20 73 74 61 |assigns |time sta|
|00001020| 6d 70 73 20 74 6f 20 65 | 61 63 68 20 70 61 63 6b |mps to e|ach pack|
|00001030| 65 74 20 6f 66 20 4d 49 | 44 49 20 64 61 74 61 20 |et of MI|DI data |
|00001040| 69 6e 20 61 6e 79 20 6f | 66 20 61 20 76 61 72 69 |in any o|f a vari|
|00001050| 65 74 79 20 6f 66 20 66 | 6f 72 6d 61 74 73 2c 20 |ety of f|ormats, |
|00001060| 61 6e 64 20 63 6f 6e 76 | 65 72 74 73 20 66 72 6f |and conv|erts fro|
|00001070| 6d 20 6f 6e 65 20 66 6f | 72 6d 61 74 20 74 6f 20 |m one fo|rmat to |
|00001080| 61 6e 6f 74 68 65 72 2e | 20 0d 54 68 65 20 4d 49 |another.| .The MI|
|00001090| 44 49 20 4d 61 6e 61 67 | 65 72 20 54 6f 6f 6c 20 |DI Manag|er Tool |
|000010a0| 53 65 74 20 69 73 20 61 | 63 74 75 61 6c 6c 79 20 |Set is a|ctually |
|000010b0| 6d 61 64 65 20 75 70 20 | 6f 66 20 61 20 6e 75 6d |made up |of a num|
|000010c0| 62 65 72 20 6f 66 20 70 | 69 65 63 65 73 2e 20 54 |ber of p|ieces. T|
|000010d0| 68 69 73 20 64 6f 63 75 | 6d 65 6e 74 20 64 65 73 |his docu|ment des|
|000010e0| 63 72 69 62 65 73 20 74 | 68 65 20 4d 49 44 49 20 |cribes t|he MIDI |
|000010f0| 4d 61 6e 61 67 65 72 20 | 61 6e 64 20 69 74 73 20 |Manager |and its |
|00001100| 74 69 6d 65 72 20 61 6e | 64 20 6d 65 73 73 61 67 |timer an|d messag|
|00001110| 65 20 68 61 6e 64 6c 69 | 6e 67 20 66 61 63 69 6c |e handli|ng facil|
|00001120| 69 74 69 65 73 2e 20 49 | 74 20 6d 61 6b 65 73 20 |ities. I|t makes |
|00001130| 6f 6e 6c 79 20 70 61 73 | 73 69 6e 67 20 6d 65 6e |only pas|sing men|
|00001140| 74 69 6f 6e 20 6f 66 20 | 50 61 74 63 68 42 61 79 |tion of |PatchBay|
|00001150| aa 2c 20 61 20 67 72 61 | 70 68 69 63 20 69 6e 74 |., a gra|phic int|
|00001160| 65 72 66 61 63 65 20 66 | 6f 72 20 63 6f 6e 6e 65 |erface f|or conne|
|00001170| 63 74 69 6e 67 20 70 6f | 72 74 73 3b 20 74 68 65 |cting po|rts; the|
|00001180| 20 41 70 70 6c 65 20 4d | 49 44 49 20 44 72 69 76 | Apple M|IDI Driv|
|00001190| 65 72 3b 20 61 6e 64 20 | 53 71 75 69 64 43 61 6b |er; and |SquidCak|
|000011a0| 65 73 2c 20 61 20 6d 69 | 6e 69 6d 61 6c 20 4d 49 |es, a mi|nimal MI|
|000011b0| 44 49 20 74 65 72 6d 69 | 6e 61 6c 20 77 69 74 68 |DI termi|nal with|
|000011c0| 20 76 65 72 79 20 73 69 | 6d 70 6c 65 20 73 65 71 | very si|mple seq|
|000011d0| 75 65 6e 63 65 20 72 65 | 63 6f 72 64 69 6e 67 20 |uence re|cording |
|000011e0| 63 61 70 61 62 69 6c 69 | 74 69 65 73 2e 20 28 50 |capabili|ties. (P|
|000011f0| 61 74 63 68 42 61 79 20 | 77 69 6c 6c 20 62 65 20 |atchBay |will be |
|00001200| 63 6f 6d 70 6c 65 74 65 | 6c 79 20 64 65 73 63 72 |complete|ly descr|
|00001210| 69 62 65 64 20 69 6e 20 | 61 20 66 75 74 75 72 65 |ibed in |a future|
|00001220| 20 64 6f 63 75 6d 65 6e | 74 3b 20 74 6f 20 6c 65 | documen|t; to le|
|00001230| 61 72 6e 20 6d 6f 72 65 | 20 61 62 6f 75 74 20 53 |arn more| about S|
|00001240| 71 75 69 64 43 61 6b 65 | 73 20 73 65 65 20 74 68 |quidCake|s see th|
|00001250| 65 20 73 6f 75 72 63 65 | 20 63 6f 64 65 20 6f 6e |e source| code on|
|00001260| 20 74 68 65 20 64 65 76 | 65 6c 6f 70 65 72 20 72 | the dev|eloper r|
|00001270| 65 6c 65 61 73 65 20 64 | 69 73 6b 2e 29 20 0d 4e |elease d|isk.) .N|
|00001280| 6f 74 65 3a 20 54 68 69 | 73 20 64 6f 63 75 6d 65 |ote: Thi|s docume|
|00001290| 6e 74 20 61 73 73 75 6d | 65 73 20 74 68 61 74 20 |nt assum|es that |
|000012a0| 74 68 65 20 72 65 61 64 | 65 72 20 68 61 73 20 73 |the read|er has s|
|000012b0| 6f 6d 65 20 66 61 6d 69 | 6c 69 61 72 69 74 79 20 |ome fami|liarity |
|000012c0| 77 69 74 68 20 4d 49 44 | 49 2e 20 52 65 61 64 65 |with MID|I. Reade|
|000012d0| 72 73 20 77 61 6e 74 69 | 6e 67 20 74 6f 20 66 69 |rs wanti|ng to fi|
|000012e0| 6e 64 20 6f 75 74 20 6d | 6f 72 65 20 61 62 6f 75 |nd out m|ore abou|
|000012f0| 74 20 4d 49 44 49 20 61 | 72 65 20 72 65 66 65 72 |t MIDI a|re refer|
|00001300| 72 65 64 20 74 6f 20 74 | 68 65 20 4d 49 44 49 20 |red to t|he MIDI |
|00001310| 31 2e 30 20 53 70 65 63 | 69 66 69 63 61 74 69 6f |1.0 Spec|ificatio|
|00001320| 6e 2c 20 61 76 61 69 6c | 61 62 6c 65 20 66 72 6f |n, avail|able fro|
|00001330| 6d 20 74 68 65 20 49 6e | 74 65 72 6e 61 74 69 6f |m the In|ternatio|
|00001340| 6e 61 6c 20 4d 49 44 49 | 20 41 73 73 6f 63 69 61 |nal MIDI| Associa|
|00001350| 74 69 6f 6e 20 6f 72 20 | 61 6e 79 20 6f 66 20 74 |tion or |any of t|
|00001360| 68 65 20 69 6e 63 72 65 | 61 73 69 6e 67 20 6e 75 |he incre|asing nu|
|00001370| 6d 62 65 72 20 6f 66 20 | 67 6f 6f 64 20 62 6f 6f |mber of |good boo|
|00001380| 6b 73 20 6f 6e 20 4d 49 | 44 49 2e 0d 48 6f 77 20 |ks on MI|DI..How |
|00001390| 54 68 65 20 4d 49 44 49 | 20 4d 61 6e 61 67 65 72 |The MIDI| Manager|
|000013a0| 20 77 6f 72 6b 73 0d 54 | 68 65 20 4d 49 44 49 20 | works.T|he MIDI |
|000013b0| 4d 61 6e 61 67 65 72 20 | 6f 70 65 72 61 74 65 73 |Manager |operates|
|000013c0| 20 74 68 72 6f 75 67 68 | 20 75 73 65 20 6f 66 20 | through| use of |
|000013d0| 6c 6f 67 69 63 61 6c 20 | 70 6f 72 74 73 2e 20 54 |logical |ports. T|
|000013e0| 68 65 73 65 20 70 6f 72 | 74 73 20 61 72 65 20 76 |hese por|ts are v|
|000013f0| 69 72 74 75 61 6c 20 73 | 6f 75 72 63 65 73 20 61 |irtual s|ources a|
|00001400| 6e 64 20 73 69 6e 6b 73 | 20 66 6f 72 20 4d 49 44 |nd sinks| for MID|
|00001410| 49 20 64 61 74 61 20 61 | 6e 64 20 61 72 65 20 6d |I data a|nd are m|
|00001420| 61 69 6e 74 61 69 6e 65 | 64 20 65 6e 74 69 72 65 |aintaine|d entire|
|00001430| 6c 79 20 62 79 20 74 68 | 65 20 4d 49 44 49 20 4d |ly by th|e MIDI M|
|00001440| 61 6e 61 67 65 72 2e 20 | 59 6f 75 72 20 61 70 70 |anager. |Your app|
|00001450| 6c 69 63 61 74 69 6f 6e | 20 63 61 6e 20 74 72 65 |lication| can tre|
|00001460| 61 74 20 74 68 65 6d 20 | 61 73 20 74 68 6f 75 67 |at them |as thoug|
|00001470| 68 20 74 68 65 79 20 61 | 72 65 20 61 63 74 75 61 |h they a|re actua|
|00001480| 6c 20 63 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 73 |l commun|ications|
|00001490| 20 70 6f 72 74 73 2c 20 | 61 6e 64 20 6d 61 6e 79 | ports, |and many|
|000014a0| 20 6f 66 20 74 68 65 20 | 6d 65 73 73 79 20 64 65 | of the |messy de|
|000014b0| 74 61 69 6c 73 20 6f 66 | 20 61 63 74 75 61 6c 6c |tails of| actuall|
|000014c0| 79 20 77 72 69 74 69 6e | 67 20 74 6f 20 61 6e 64 |y writin|g to and|
|000014d0| 20 72 65 61 64 69 6e 67 | 20 66 72 6f 6d 20 74 68 | reading| from th|
|000014e0| 65 20 73 65 72 69 61 6c | 20 70 6f 72 74 73 20 61 |e serial| ports a|
|000014f0| 72 65 20 68 61 6e 64 6c | 65 64 20 66 6f 72 20 79 |re handl|ed for y|
|00001500| 6f 75 2e 0d 49 6e 73 74 | 61 6c 6c 69 6e 67 20 74 |ou..Inst|alling t|
|00001510| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 0d |he MIDI |Manager.|
|00001520| 54 68 65 20 4d 49 44 49 | 20 4d 61 6e 61 67 65 72 |The MIDI| Manager|
|00001530| 20 63 6f 64 65 20 69 73 | 20 63 6f 6e 74 61 69 6e | code is| contain|
|00001540| 65 64 20 69 6e 20 61 6e | 20 49 4e 49 54 20 66 69 |ed in an| INIT fi|
|00001550| 6c 65 20 6e 61 6d 65 64 | 20 d2 4d 49 44 49 20 4d |le named| .MIDI M|
|00001560| 61 6e 61 67 65 72 d3 2e | 20 54 6f 20 69 6e 73 74 |anager..| To inst|
|00001570| 61 6c 6c 20 74 68 65 20 | 4d 49 44 49 20 4d 61 6e |all the |MIDI Man|
|00001580| 61 67 65 72 20 6d 6f 76 | 65 20 74 68 65 20 4d 49 |ager mov|e the MI|
|00001590| 44 49 20 4d 61 6e 61 67 | 65 72 20 61 6e 64 20 74 |DI Manag|er and t|
|000015a0| 68 65 20 41 70 70 6c 65 | 20 4d 49 44 49 20 44 72 |he Apple| MIDI Dr|
|000015b0| 69 76 65 72 20 66 69 6c | 65 73 20 69 6e 74 6f 20 |iver fil|es into |
|000015c0| 79 6f 75 72 20 53 79 73 | 74 65 6d 20 66 6f 6c 64 |your Sys|tem fold|
|000015d0| 65 72 20 61 6e 64 20 72 | 65 73 74 61 72 74 20 79 |er and r|estart y|
|000015e0| 6f 75 72 20 4d 61 63 69 | 6e 74 6f 73 68 2e 20 54 |our Maci|ntosh. T|
|000015f0| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 20 |he MIDI |Manager |
|00001600| 63 6f 64 65 20 77 69 6c | 6c 20 74 68 65 6e 20 62 |code wil|l then b|
|00001610| 65 20 61 76 61 69 6c 61 | 62 6c 65 20 74 6f 20 79 |e availa|ble to y|
|00001620| 6f 75 72 20 70 72 6f 67 | 72 61 6d 73 2e 20 57 68 |our prog|rams. Wh|
|00001630| 65 6e 20 74 68 65 20 66 | 69 72 73 74 20 61 70 70 |en the f|irst app|
|00001640| 6c 69 63 61 74 69 6f 6e | 20 73 69 67 6e 73 20 69 |lication| signs i|
|00001650| 6e 2c 20 74 68 65 20 4d | 49 44 49 20 4d 61 6e 61 |n, the M|IDI Mana|
|00001660| 67 65 72 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |ger auto|maticall|
|00001670| 79 20 6c 6f 61 64 73 20 | 4d 49 44 49 20 64 72 69 |y loads |MIDI dri|
|00001680| 76 65 72 73 20 74 68 61 | 74 20 61 72 65 20 70 72 |vers tha|t are pr|
|00001690| 65 73 65 6e 74 20 69 6e | 20 74 68 65 20 53 79 73 |esent in| the Sys|
|000016a0| 74 65 6d 20 66 6f 6c 64 | 65 72 2e 20 49 74 20 61 |tem fold|er. It a|
|000016b0| 6c 73 6f 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |lso auto|maticall|
|000016c0| 79 20 64 69 73 70 6f 73 | 65 73 20 6f 66 20 4d 49 |y dispos|es of MI|
|000016d0| 44 49 20 64 72 69 76 65 | 72 73 20 77 68 65 6e 20 |DI drive|rs when |
|000016e0| 74 68 65 20 6c 61 73 74 | 20 61 70 70 6c 69 63 61 |the last| applica|
|000016f0| 74 69 6f 6e 20 73 69 67 | 6e 73 20 6f 75 74 2e 0d |tion sig|ns out..|
|00001700| 53 69 67 6e 69 6e 67 20 | 69 6e 20 74 6f 20 74 68 |Signing |in to th|
|00001710| 65 20 4d 49 44 49 20 4d | 61 6e 61 67 65 72 0d 41 |e MIDI M|anager.A|
|00001720| 6e 79 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 74 |ny appli|cation t|
|00001730| 68 61 74 20 75 73 65 73 | 20 74 68 65 20 4d 49 44 |hat uses| the MID|
|00001740| 49 20 4d 61 6e 61 67 65 | 72 20 6d 75 73 74 20 66 |I Manage|r must f|
|00001750| 69 72 73 74 20 73 69 67 | 6e 20 69 6e 2c 20 62 65 |irst sig|n in, be|
|00001760| 63 6f 6d 69 6e 67 20 61 | 20 4d 49 44 49 20 4d 61 |coming a| MIDI Ma|
|00001770| 6e 61 67 65 72 20 63 6c | 69 65 6e 74 2e 20 54 6f |nager cl|ient. To|
|00001780| 20 73 69 67 6e 20 69 6e | 2c 20 61 6e 20 61 70 70 | sign in|, an app|
|00001790| 6c 69 63 61 74 69 6f 6e | 20 70 61 73 73 65 73 20 |lication| passes |
|000017a0| 61 20 75 6e 69 71 75 65 | 20 63 6c 69 65 6e 74 20 |a unique| client |
|000017b0| 69 64 65 6e 74 69 66 69 | 65 72 20 61 6e 64 20 61 |identifi|er and a|
|000017c0| 20 6e 61 6d 65 20 74 6f | 20 74 68 65 20 4d 49 44 | name to| the MID|
|000017d0| 49 20 4d 61 6e 61 67 65 | 72 2e 20 41 6c 74 68 6f |I Manage|r. Altho|
|000017e0| 75 67 68 20 74 68 65 20 | 6e 61 6d 65 20 63 61 6e |ugh the |name can|
|000017f0| 20 62 65 20 61 6e 79 20 | 50 61 73 63 61 6c 20 73 | be any |Pascal s|
|00001800| 74 72 69 6e 67 2c 20 74 | 68 65 20 69 64 65 6e 74 |tring, t|he ident|
|00001810| 69 66 69 65 72 20 6d 75 | 73 74 20 62 65 20 61 20 |ifier mu|st be a |
|00001820| 34 2d 62 79 74 65 20 76 | 61 6c 75 65 20 6f 66 20 |4-byte v|alue of |
|00001830| 74 79 70 65 20 4f 53 54 | 79 70 65 3b 20 61 6e 20 |type OST|ype; an |
|00001840| 6f 62 76 69 6f 75 73 20 | 63 68 6f 69 63 65 20 66 |obvious |choice f|
|00001850| 6f 72 20 74 68 65 20 69 | 64 65 6e 74 69 66 69 65 |or the i|dentifie|
|00001860| 72 20 69 73 20 74 68 65 | 20 61 70 70 6c 69 63 61 |r is the| applica|
|00001870| 74 69 6f 6e d5 73 20 63 | 72 65 61 74 6f 72 2c 20 |tion.s c|reator, |
|00001880| 6f 72 20 73 69 67 6e 61 | 74 75 72 65 2c 20 62 65 |or signa|ture, be|
|00001890| 63 61 75 73 65 20 74 68 | 69 73 20 34 2d 62 79 74 |cause th|is 4-byt|
|000018a0| 65 20 76 61 6c 75 65 20 | 69 73 20 67 75 61 72 61 |e value |is guara|
|000018b0| 6e 74 65 65 64 20 74 6f | 20 62 65 20 75 6e 69 71 |nteed to| be uniq|
|000018c0| 75 65 20 74 6f 20 65 61 | 63 68 20 61 70 70 6c 69 |ue to ea|ch appli|
|000018d0| 63 61 74 69 6f 6e 2e 0d | 43 72 65 61 74 69 6e 67 |cation..|Creating|
|000018e0| 20 70 6f 72 74 73 0d 41 | 6e 20 61 70 70 6c 69 63 | ports.A|n applic|
|000018f0| 61 74 69 6f 6e 20 74 68 | 61 74 20 68 61 73 20 73 |ation th|at has s|
|00001900| 69 67 6e 65 64 20 69 6e | 20 74 6f 20 74 68 65 20 |igned in| to the |
|00001910| 4d 49 44 49 20 4d 61 6e | 61 67 65 72 20 63 61 6e |MIDI Man|ager can|
|00001920| 20 63 72 65 61 74 65 20 | 4d 49 44 49 20 70 6f 72 | create |MIDI por|
|00001930| 74 73 20 74 68 72 6f 75 | 67 68 20 77 68 69 63 68 |ts throu|gh which|
|00001940| 20 74 6f 20 70 61 73 73 | 20 4d 49 44 49 20 64 61 | to pass| MIDI da|
|00001950| 74 61 2e 20 45 61 63 68 | 20 70 6f 72 74 20 61 6e |ta. Each| port an|
|00001960| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 63 72 65 | applica|tion cre|
|00001970| 61 74 65 73 20 63 61 6e | 20 62 65 20 65 69 74 68 |ates can| be eith|
|00001980| 65 72 20 61 20 74 69 6d | 65 20 62 61 73 65 2c 20 |er a tim|e base, |
|00001990| 77 68 69 63 68 20 70 72 | 6f 76 69 64 65 73 20 74 |which pr|ovides t|
|000019a0| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 d5 |he MIDI |Manager.|
|000019b0| 73 20 74 69 6d 69 6e 67 | 20 66 61 63 69 6c 69 74 |s timing| facilit|
|000019c0| 69 65 73 2c 20 6f 72 20 | 61 20 64 61 74 61 20 70 |ies, or |a data p|
|000019d0| 6f 72 74 20 77 68 69 63 | 68 20 69 73 20 75 73 65 |ort whic|h is use|
|000019e0| 64 20 74 6f 20 72 65 61 | 64 20 61 6e 64 20 77 72 |d to rea|d and wr|
|000019f0| 69 74 65 20 4d 49 44 49 | 20 70 61 63 6b 65 74 73 |ite MIDI| packets|
|00001a00| 2e 0d 45 61 63 68 20 64 | 61 74 61 20 70 6f 72 74 |..Each d|ata port|
|00001a10| 20 69 73 20 65 69 74 68 | 65 72 20 61 6e 20 69 6e | is eith|er an in|
|00001a20| 70 75 74 20 70 6f 72 74 | 20 6f 72 20 61 6e 20 6f |put port| or an o|
|00001a30| 75 74 70 75 74 20 70 6f | 72 74 3b 20 6e 6f 20 64 |utput po|rt; no d|
|00001a40| 61 74 61 20 70 6f 72 74 | 20 63 61 6e 20 62 65 20 |ata port| can be |
|00001a50| 62 6f 74 68 2e 20 54 6f | 20 70 61 73 73 20 4d 49 |both. To| pass MI|
|00001a60| 44 49 20 64 61 74 61 20 | 79 6f 75 20 63 6f 6e 6e |DI data |you conn|
|00001a70| 65 63 74 20 61 6e 20 6f | 75 74 70 75 74 20 70 6f |ect an o|utput po|
|00001a80| 72 74 20 74 6f 20 61 6e | 20 69 6e 70 75 74 20 70 |rt to an| input p|
|00001a90| 6f 72 74 2c 20 77 68 69 | 63 68 20 69 73 2c 20 69 |ort, whi|ch is, i|
|00001aa0| 6e 20 65 66 66 65 63 74 | 2c 20 6a 75 73 74 20 6c |n effect|, just l|
|00001ab0| 69 6b 65 20 63 6f 6e 6e | 65 63 74 69 6e 67 20 4d |ike conn|ecting M|
|00001ac0| 49 44 49 20 63 61 62 6c | 65 73 2e 20 41 20 64 61 |IDI cabl|es. A da|
|00001ad0| 74 61 20 70 6f 72 74 20 | 63 61 6e 20 62 65 20 63 |ta port |can be c|
|00001ae0| 6f 6e 6e 65 63 74 65 64 | 20 74 6f 20 73 65 76 65 |onnected| to seve|
|00001af0| 72 61 6c 20 6f 74 68 65 | 72 20 64 61 74 61 20 70 |ral othe|r data p|
|00001b00| 6f 72 74 73 2c 20 61 75 | 74 6f 6d 61 74 69 63 61 |orts, au|tomatica|
|00001b10| 6c 6c 79 20 73 70 6c 69 | 74 74 69 6e 67 20 6f 75 |lly spli|tting ou|
|00001b20| 74 67 6f 69 6e 67 20 64 | 61 74 61 20 61 6e 64 20 |tgoing d|ata and |
|00001b30| 6d 65 72 67 69 6e 67 20 | 69 6e 63 6f 6d 69 6e 67 |merging |incoming|
|00001b40| 20 64 61 74 61 20 61 73 | 20 6e 65 63 65 73 73 61 | data as| necessa|
|00001b50| 72 79 2e 0d 49 66 20 61 | 20 63 6c 69 65 6e 74 20 |ry..If a| client |
|00001b60| 6e 65 65 64 73 20 74 69 | 6d 65 20 73 65 72 76 69 |needs ti|me servi|
|00001b70| 63 65 73 20 69 74 20 6d | 75 73 74 20 63 72 65 61 |ces it m|ust crea|
|00001b80| 74 65 20 61 74 20 6c 65 | 61 73 74 20 6f 6e 65 20 |te at le|ast one |
|00001b90| 74 69 6d 65 20 62 61 73 | 65 2e 20 41 20 74 69 6d |time bas|e. A tim|
|00001ba0| 65 20 62 61 73 65 20 63 | 61 6e 20 62 65 20 63 6f |e base c|an be co|
|00001bb0| 6e 6e 65 63 74 65 64 20 | 74 6f 20 73 65 76 65 72 |nnected |to sever|
|00001bc0| 61 6c 20 70 6f 72 74 73 | 2c 20 72 65 67 61 72 64 |al ports|, regard|
|00001bd0| 6c 65 73 73 20 6f 66 20 | 77 68 65 74 68 65 72 20 |less of |whether |
|00001be0| 74 68 65 79 20 61 72 65 | 20 69 6e 70 75 74 2c 20 |they are| input, |
|00001bf0| 6f 75 74 70 75 74 20 6f | 72 20 74 69 6d 65 20 70 |output o|r time p|
|00001c00| 6f 72 74 73 2e 20 57 68 | 65 6e 20 74 68 65 20 74 |orts. Wh|en the t|
|00001c10| 69 6d 65 20 62 61 73 65 | d5 73 20 63 6c 6f 63 6b |ime base|.s clock|
|00001c20| 20 74 69 63 6b 73 2c 20 | 61 6c 6c 20 63 6c 6f 63 | ticks, |all cloc|
|00001c30| 6b 73 20 6f 66 20 61 6c | 6c 20 70 6f 72 74 73 20 |ks of al|l ports |
|00001c40| 63 6f 6e 6e 65 63 74 65 | 64 20 74 6f 20 69 74 20 |connecte|d to it |
|00001c50| 74 69 63 6b 2c 20 73 79 | 6e 63 68 72 6f 6e 69 7a |tick, sy|nchroniz|
|00001c60| 69 6e 67 20 74 68 65 20 | 63 6c 6f 63 6b 73 20 6f |ing the |clocks o|
|00001c70| 66 20 61 6c 6c 20 74 68 | 65 20 63 6f 6e 6e 65 63 |f all th|e connec|
|00001c80| 74 65 64 20 70 6f 72 74 | 73 2e 0d 4e 6f 72 6d 61 |ted port|s..Norma|
|00001c90| 6c 6c 79 20 61 6e 20 61 | 70 70 6c 69 63 61 74 69 |lly an a|pplicati|
|00001ca0| 6f 6e 20 77 69 6c 6c 20 | 63 72 65 61 74 65 20 61 |on will |create a|
|00001cb0| 20 74 69 6d 65 20 62 61 | 73 65 20 62 65 66 6f 72 | time ba|se befor|
|00001cc0| 65 20 63 72 65 61 74 69 | 6e 67 20 61 6e 79 20 6f |e creati|ng any o|
|00001cd0| 74 68 65 72 20 70 6f 72 | 74 73 2e 20 57 68 65 6e |ther por|ts. When|
|00001ce0| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00001cf0| 20 64 6f 65 73 20 63 72 | 65 61 74 65 20 61 6e 6f | does cr|eate ano|
|00001d00| 74 68 65 72 20 70 6f 72 | 74 2c 20 69 74 20 70 61 |ther por|t, it pa|
|00001d10| 73 73 65 73 20 74 68 65 | 20 72 65 66 65 72 65 6e |sses the| referen|
|00001d20| 63 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 74 68 65 |ce numbe|r of the|
|00001d30| 20 74 69 6d 65 20 62 61 | 73 65 20 69 6e 20 74 68 | time ba|se in th|
|00001d40| 65 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |e initia|lization|
|00001d50| 20 72 65 63 6f 72 64 20 | 6f 66 20 74 68 65 20 6e | record |of the n|
|00001d60| 65 77 20 64 61 74 61 20 | 70 6f 72 74 20 61 6e 64 |ew data |port and|
|00001d70| 20 74 68 65 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 | the MID|I Manage|
|00001d80| 72 20 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 |r automa|tically |
|00001d90| 63 6f 6e 6e 65 63 74 73 | 20 74 68 65 20 6e 65 77 |connects| the new|
|00001da0| 20 70 6f 72 74 20 74 6f | 20 74 68 65 20 74 69 6d | port to| the tim|
|00001db0| 65 20 62 61 73 65 2e 0d | 57 68 65 6e 20 61 20 64 |e base..|When a d|
|00001dc0| 61 74 61 20 70 6f 72 74 | 20 69 73 20 63 6f 6e 6e |ata port| is conn|
|00001dd0| 65 63 74 65 64 20 74 6f | 20 61 20 74 69 6d 65 20 |ected to| a time |
|00001de0| 62 61 73 65 20 74 68 65 | 20 74 69 6d 65 20 62 61 |base the| time ba|
|00001df0| 73 65 20 70 72 6f 76 69 | 64 65 73 20 61 20 63 6c |se provi|des a cl|
|00001e00| 6f 63 6b 20 66 6f 72 20 | 74 68 65 20 64 61 74 61 |ock for |the data|
|00001e10| 20 70 6f 72 74 2e 20 49 | 66 20 61 20 64 61 74 61 | port. I|f a data|
|00001e20| 20 70 6f 72 74 20 69 73 | 20 6e 6f 74 20 63 6f 6e | port is| not con|
|00001e30| 6e 65 63 74 65 64 20 74 | 6f 20 61 20 74 69 6d 65 |nected t|o a time|
|00001e40| 20 62 61 73 65 20 74 68 | 65 6e 20 74 68 65 20 64 | base th|en the d|
|00001e50| 61 74 61 20 70 6f 72 74 | d5 73 20 63 6c 6f 63 6b |ata port|.s clock|
|00001e60| 20 72 65 6d 61 69 6e 73 | 20 61 74 20 30 2c 20 61 | remains| at 0, a|
|00001e70| 6e 64 20 61 6c 6c 20 4d | 49 44 49 20 70 61 63 6b |nd all M|IDI pack|
|00001e80| 65 74 73 20 70 61 73 73 | 65 64 20 74 68 72 6f 75 |ets pass|ed throu|
|00001e90| 67 68 20 74 68 65 20 64 | 61 74 61 20 70 6f 72 74 |gh the d|ata port|
|00001ea0| 20 61 72 65 20 73 74 61 | 6d 70 65 64 20 77 69 74 | are sta|mped wit|
|00001eb0| 68 20 61 20 74 69 6d 65 | 20 76 61 6c 75 65 20 6f |h a time| value o|
|00001ec0| 66 20 30 2e 20 0d 59 6f | 75 20 6d 75 73 74 20 74 |f 0. .Yo|u must t|
|00001ed0| 61 6b 65 20 69 6e 74 6f | 20 61 63 63 6f 75 6e 74 |ake into| account|
|00001ee0| 20 74 68 65 20 77 61 79 | 20 74 68 65 20 4d 49 44 | the way| the MID|
|00001ef0| 49 20 4d 61 6e 61 67 65 | 72 20 77 6f 72 6b 73 20 |I Manage|r works |
|00001f00| 77 68 65 6e 20 70 6c 61 | 6e 6e 69 6e 67 20 6d 65 |when pla|nning me|
|00001f10| 6d 6f 72 79 20 6d 61 6e | 61 67 65 6d 65 6e 74 2e |mory man|agement.|
|00001f20| 20 41 6c 6c 20 64 61 74 | 61 20 73 74 72 75 63 74 | All dat|a struct|
|00001f30| 75 72 65 73 20 73 70 65 | 63 69 66 69 63 20 74 6f |ures spe|cific to|
|00001f40| 20 61 20 63 6c 69 65 6e | 74 20 61 72 65 20 61 6c | a clien|t are al|
|00001f50| 6c 6f 63 61 74 65 64 20 | 69 6e 20 74 68 65 20 63 |located |in the c|
|00001f60| 6c 69 65 6e 74 d5 73 20 | 68 65 61 70 2e 20 4d 6f |lient.s |heap. Mo|
|00001f70| 73 74 20 6f 66 20 74 68 | 65 73 65 20 64 61 74 61 |st of th|ese data|
|00001f80| 20 73 74 72 75 63 74 75 | 72 65 73 20 61 72 65 20 | structu|res are |
|00001f90| 6c 6f 63 6b 65 64 2e 20 | 41 6c 6c 20 70 6f 72 74 |locked. |All port|
|00001fa0| 73 20 61 6e 64 20 62 75 | 66 66 65 72 73 20 61 72 |s and bu|ffers ar|
|00001fb0| 65 20 6c 6f 63 6b 65 64 | 20 77 68 65 6e 20 74 68 |e locked| when th|
|00001fc0| 65 79 20 61 72 65 20 63 | 72 65 61 74 65 64 20 62 |ey are c|reated b|
|00001fd0| 65 63 61 75 73 65 20 74 | 68 65 20 4d 49 44 49 20 |ecause t|he MIDI |
|00001fe0| 4d 61 6e 61 67 65 72 20 | 6d 75 73 74 20 61 63 63 |Manager |must acc|
|00001ff0| 65 73 73 20 74 68 65 20 | 64 61 74 61 20 73 74 72 |ess the |data str|
|00002000| 75 63 74 75 72 65 73 20 | 66 72 6f 6d 20 69 6e 74 |uctures |from int|
|00002010| 65 72 72 75 70 74 20 6c | 65 76 65 6c 2e 20 45 76 |errupt l|evel. Ev|
|00002020| 65 72 79 20 65 66 66 6f | 72 74 20 69 73 20 6d 61 |ery effo|rt is ma|
|00002030| 64 65 20 74 6f 20 6d 69 | 6e 69 6d 69 7a 65 20 66 |de to mi|nimize f|
|00002040| 72 61 67 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |ragmenta|tion of |
|00002050| 74 68 65 20 63 6c 69 65 | 6e 74 d5 73 20 68 65 61 |the clie|nt.s hea|
|00002060| 70 20 77 68 65 6e 20 61 | 6c 6c 6f 63 61 74 69 6e |p when a|llocatin|
|00002070| 67 20 74 68 65 73 65 20 | 62 6c 6f 63 6b 73 2e 20 |g these |blocks. |
|00002080| 57 68 65 6e 20 61 20 63 | 6c 69 65 6e 74 20 73 69 |When a c|lient si|
|00002090| 67 6e 73 20 6f 75 74 2c | 20 74 68 65 20 4d 49 44 |gns out,| the MID|
|000020a0| 49 20 4d 61 6e 61 67 65 | 72 20 64 65 61 6c 6c 6f |I Manage|r deallo|
|000020b0| 63 61 74 65 73 20 61 6e | 79 20 6d 65 6d 6f 72 79 |cates an|y memory|
|000020c0| 20 69 74 20 68 61 73 20 | 61 6c 6c 6f 63 61 74 65 | it has |allocate|
|000020d0| 64 20 66 6f 72 20 74 68 | 61 74 20 63 6c 69 65 6e |d for th|at clien|
|000020e0| 74 2e 0d 57 68 65 6e 20 | 74 68 65 20 4d 49 44 49 |t..When |the MIDI|
|000020f0| 20 4d 61 6e 61 67 65 72 | 20 72 65 74 75 72 6e 73 | Manager| returns|
|00002100| 20 61 20 68 61 6e 64 6c | 65 20 74 6f 20 61 20 64 | a handl|e to a d|
|00002110| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 28 73 |ata stru|cture (s|
|00002120| 75 63 68 20 61 73 20 61 | 20 70 6f 72 74 49 6e 66 |uch as a| portInf|
|00002130| 6f 52 65 63 29 2c 20 74 | 68 61 74 20 62 6c 6f 63 |oRec), t|hat bloc|
|00002140| 6b 20 69 73 20 61 6c 6c | 6f 63 61 74 65 64 20 69 |k is all|ocated i|
|00002150| 6e 20 74 68 65 20 63 61 | 6c 6c 65 72 d5 73 20 68 |n the ca|ller.s h|
|00002160| 65 61 70 2c 20 62 75 74 | 20 69 73 20 6e 6f 74 20 |eap, but| is not |
|00002170| 6c 6f 63 6b 65 64 2e 20 | 54 68 65 20 63 61 6c 6c |locked. |The call|
|00002180| 65 72 20 69 73 20 72 65 | 73 70 6f 6e 73 69 62 6c |er is re|sponsibl|
|00002190| 65 20 66 6f 72 20 64 65 | 61 6c 6c 6f 63 61 74 69 |e for de|allocati|
|000021a0| 6e 67 20 74 68 65 20 62 | 6c 6f 63 6b 20 77 68 65 |ng the b|lock whe|
|000021b0| 6e 20 69 74 20 69 73 20 | 6e 6f 20 6c 6f 6e 67 65 |n it is |no longe|
|000021c0| 72 20 69 6e 20 75 73 65 | 20 62 65 63 61 75 73 65 |r in use| because|
|000021d0| 20 74 68 65 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 | the MID|I Manage|
|000021e0| 72 20 68 61 73 20 6e 6f | 20 77 61 79 20 74 6f 20 |r has no| way to |
|000021f0| 64 65 74 65 72 6d 69 6e | 65 20 77 68 65 6e 20 74 |determin|e when t|
|00002200| 68 65 20 63 61 6c 6c 65 | 72 20 68 61 73 20 66 69 |he calle|r has fi|
|00002210| 6e 69 73 68 65 64 20 77 | 69 74 68 20 74 68 65 20 |nished w|ith the |
|00002220| 62 6c 6f 63 6b 2e 0d 49 | 64 65 6e 74 69 66 69 65 |block..I|dentifie|
|00002230| 72 73 20 61 6e 64 20 72 | 65 66 65 72 65 6e 63 65 |rs and r|eference|
|00002240| 20 6e 75 6d 62 65 72 73 | 0d 43 6c 69 65 6e 74 73 | numbers|.Clients|
|00002250| 2c 20 64 61 74 61 20 70 | 6f 72 74 73 2c 20 61 6e |, data p|orts, an|
|00002260| 64 20 74 69 6d 65 20 62 | 61 73 65 73 20 63 61 6e |d time b|ases can|
|00002270| 20 62 65 20 64 69 73 74 | 69 6e 67 75 69 73 68 65 | be dist|inguishe|
|00002280| 64 20 65 69 74 68 65 72 | 20 62 79 20 69 64 65 6e |d either| by iden|
|00002290| 74 69 66 69 65 72 73 20 | 6f 72 20 72 65 66 65 72 |tifiers |or refer|
|000022a0| 65 6e 63 65 20 6e 75 6d | 62 65 72 73 2e 20 41 6e |ence num|bers. An|
|000022b0| 20 69 64 65 6e 74 69 66 | 69 65 72 20 69 73 20 61 | identif|ier is a|
|000022c0| 20 34 2d 62 79 74 65 20 | 76 61 6c 75 65 20 6f 66 | 4-byte |value of|
|000022d0| 20 74 79 70 65 20 4f 53 | 54 79 70 65 2e 20 4e 6f | type OS|Type. No|
|000022e0| 20 74 77 6f 20 73 69 67 | 6e 65 64 2d 69 6e 20 63 | two sig|ned-in c|
|000022f0| 6c 69 65 6e 74 73 20 6d | 61 79 20 68 61 76 65 20 |lients m|ay have |
|00002300| 74 68 65 20 73 61 6d 65 | 20 69 64 65 6e 74 69 66 |the same| identif|
|00002310| 69 65 72 2c 20 61 6e 64 | 20 6e 6f 20 74 77 6f 20 |ier, and| no two |
|00002320| 70 6f 72 74 73 20 63 72 | 65 61 74 65 64 20 62 79 |ports cr|eated by|
|00002330| 20 74 68 65 20 73 61 6d | 65 20 63 6c 69 65 6e 74 | the sam|e client|
|00002340| 20 6d 61 79 20 68 61 76 | 65 20 74 68 65 20 73 61 | may hav|e the sa|
|00002350| 6d 65 20 69 64 65 6e 74 | 69 66 69 65 72 2e 20 54 |me ident|ifier. T|
|00002360| 68 65 20 4d 49 44 49 20 | 4d 61 6e 61 67 65 72 20 |he MIDI |Manager |
|00002370| 61 73 73 69 67 6e 73 20 | 72 65 66 65 72 65 6e 63 |assigns |referenc|
|00002380| 65 20 6e 75 6d 62 65 72 | 73 20 77 68 65 6e 20 61 |e number|s when a|
|00002390| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 63 72 65 61 |pplicati|ons crea|
|000023a0| 74 65 20 70 6f 72 74 73 | 2c 20 61 6e 64 20 74 68 |te ports|, and th|
|000023b0| 65 72 65 20 69 73 20 61 | 20 75 6e 69 71 75 65 20 |ere is a| unique |
|000023c0| 72 65 66 65 72 65 6e 63 | 65 20 6e 75 6d 62 65 72 |referenc|e number|
|000023d0| 20 66 6f 72 20 65 76 65 | 72 79 20 65 78 69 73 74 | for eve|ry exist|
|000023e0| 69 6e 67 20 70 6f 72 74 | 2e 20 54 68 65 72 65 20 |ing port|. There |
|000023f0| 61 72 65 20 63 65 72 74 | 61 69 6e 20 63 61 6c 6c |are cert|ain call|
|00002400| 73 20 74 68 61 74 20 61 | 72 65 20 6e 6f 72 6d 61 |s that a|re norma|
|00002410| 6c 6c 79 20 75 73 65 64 | 20 62 79 20 61 20 63 6c |lly used| by a cl|
|00002420| 69 65 6e 74 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ient app|lication|
|00002430| 20 74 6f 20 61 66 66 65 | 63 74 20 70 6f 72 74 73 | to affe|ct ports|
|00002440| 20 69 74 20 68 61 73 20 | 63 72 65 61 74 65 64 2e | it has |created.|
|00002450| 20 43 61 6c 6c 73 20 74 | 68 61 74 20 73 68 6f 75 | Calls t|hat shou|
|00002460| 6c 64 20 6e 6f 74 20 62 | 65 20 6d 61 64 65 20 62 |ld not b|e made b|
|00002470| 79 20 61 20 63 6c 69 65 | 6e 74 20 6f 74 68 65 72 |y a clie|nt other|
|00002480| 20 74 68 61 6e 20 74 68 | 65 20 6f 6e 65 20 74 68 | than th|e one th|
|00002490| 61 74 20 63 72 65 61 74 | 65 64 20 74 68 65 20 70 |at creat|ed the p|
|000024a0| 6f 72 74 73 20 72 65 71 | 75 69 72 65 20 61 20 72 |orts req|uire a r|
|000024b0| 65 66 65 72 65 6e 63 65 | 20 6e 75 6d 62 65 72 2e |eference| number.|
|000024c0| 20 54 68 69 73 20 6d 69 | 6e 69 6d 69 7a 65 73 20 | This mi|nimizes |
|000024d0| 74 68 65 20 70 6f 73 73 | 69 62 69 6c 69 74 79 20 |the poss|ibility |
|000024e0| 74 68 61 74 20 61 20 63 | 6c 69 65 6e 74 20 6d 69 |that a c|lient mi|
|000024f0| 67 68 74 20 61 66 66 65 | 63 74 20 70 6f 72 74 73 |ght affe|ct ports|
|00002500| 20 74 68 61 74 20 64 6f | 20 6e 6f 74 20 62 65 6c | that do| not bel|
|00002510| 6f 6e 67 20 74 6f 20 69 | 74 2e 0d 57 68 65 6e 20 |ong to i|t..When |
|00002520| 61 20 63 6c 69 65 6e 74 | 20 6c 6f 6f 6b 73 20 66 |a client| looks f|
|00002530| 6f 72 20 61 20 70 6f 72 | 74 2c 20 69 74 20 6d 75 |or a por|t, it mu|
|00002540| 73 74 20 73 70 65 63 69 | 66 79 20 61 20 63 6c 69 |st speci|fy a cli|
|00002550| 65 6e 74 20 69 64 65 6e | 74 69 66 69 65 72 20 61 |ent iden|tifier a|
|00002560| 6e 64 20 61 20 70 6f 72 | 74 20 69 64 65 6e 74 69 |nd a por|t identi|
|00002570| 66 69 65 72 2c 20 6f 72 | 20 69 74 20 6d 75 73 74 |fier, or| it must|
|00002580| 20 73 70 65 63 69 66 79 | 20 61 20 72 65 66 65 72 | specify| a refer|
|00002590| 65 6e 63 65 20 6e 75 6d | 62 65 72 20 66 6f 72 20 |ence num|ber for |
|000025a0| 6f 6e 65 20 6f 66 20 69 | 74 73 20 6f 77 6e 20 70 |one of i|ts own p|
|000025b0| 6f 72 74 73 2e 20 50 61 | 74 63 68 65 72 73 2c 20 |orts. Pa|tchers, |
|000025c0| 74 68 61 74 20 69 73 2c | 20 61 70 70 6c 69 63 61 |that is,| applica|
|000025d0| 74 69 6f 6e 73 20 74 68 | 61 74 20 63 72 65 61 74 |tions th|at creat|
|000025e0| 65 20 61 6e 64 20 6d 61 | 6e 61 67 65 20 4d 49 44 |e and ma|nage MID|
|000025f0| 49 20 70 6f 72 74 73 2c | 20 75 73 65 20 69 64 65 |I ports,| use ide|
|00002600| 6e 74 69 66 69 65 72 73 | 20 74 6f 20 73 70 65 63 |ntifiers| to spec|
|00002610| 69 66 79 20 63 6f 6e 6e | 65 63 74 69 6f 6e 73 20 |ify conn|ections |
|00002620| 62 65 74 77 65 65 6e 20 | 6f 62 6a 65 63 74 73 20 |between |objects |
|00002630| 74 68 61 74 20 6d 61 79 | 20 6f 72 20 6d 61 79 20 |that may| or may |
|00002640| 6e 6f 74 20 65 78 69 73 | 74 20 77 68 65 6e 20 74 |not exis|t when t|
|00002650| 68 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 69 73 |he conne|ction is|
|00002660| 20 73 70 65 63 69 66 69 | 65 64 2e 20 49 6e 20 67 | specifi|ed. In g|
|00002670| 65 6e 65 72 61 6c 2c 20 | 61 6e 79 20 63 6c 69 65 |eneral, |any clie|
|00002680| 6e 74 20 6f 72 20 70 61 | 74 63 68 65 72 20 6d 61 |nt or pa|tcher ma|
|00002690| 79 20 6d 61 6b 65 20 63 | 61 6c 6c 73 20 74 68 61 |y make c|alls tha|
|000026a0| 74 20 72 65 71 75 69 72 | 65 20 61 6e 20 69 64 65 |t requir|e an ide|
|000026b0| 6e 74 69 66 69 65 72 2c | 20 62 75 74 20 63 61 6c |ntifier,| but cal|
|000026c0| 6c 73 20 74 68 61 74 20 | 72 65 71 75 69 72 65 20 |ls that |require |
|000026d0| 61 20 72 65 66 65 72 65 | 6e 63 65 20 6e 75 6d 62 |a refere|nce numb|
|000026e0| 65 72 20 6d 61 79 20 62 | 65 20 6d 61 64 65 20 6f |er may b|e made o|
|000026f0| 6e 6c 79 20 62 79 20 74 | 68 65 20 63 6c 69 65 6e |nly by t|he clien|
|00002700| 74 20 74 68 61 74 20 63 | 72 65 61 74 65 64 20 74 |t that c|reated t|
|00002710| 68 65 20 70 6f 72 74 2e | 0d 4d 49 44 49 20 4d 61 |he port.|.MIDI Ma|
|00002720| 6e 61 67 65 72 20 70 61 | 63 6b 65 74 73 0d 54 68 |nager pa|ckets.Th|
|00002730| 65 20 4d 49 44 49 20 4d | 61 6e 61 67 65 72 20 72 |e MIDI M|anager r|
|00002740| 65 61 64 73 20 61 6e 64 | 20 77 72 69 74 65 73 20 |eads and| writes |
|00002750| 64 61 74 61 20 69 6e 20 | 76 61 72 69 61 62 6c 79 |data in |variably|
|00002760| 20 73 69 7a 65 64 20 70 | 61 63 6b 65 74 73 20 75 | sized p|ackets u|
|00002770| 70 20 74 6f 20 32 35 35 | 20 62 79 74 65 73 20 6c |p to 255| bytes l|
|00002780| 6f 6e 67 2e 20 45 61 63 | 68 20 70 61 63 6b 65 74 |ong. Eac|h packet|
|00002790| 20 62 65 67 69 6e 73 20 | 77 69 74 68 20 61 20 36 | begins |with a 6|
|000027a0| 2d 62 79 74 65 20 68 65 | 61 64 65 72 20 63 6f 6e |-byte he|ader con|
|000027b0| 74 61 69 6e 69 6e 67 20 | 6f 6e 65 20 62 79 74 65 |taining |one byte|
|000027c0| 20 6f 66 20 66 6c 61 67 | 73 2c 20 6f 6e 65 20 62 | of flag|s, one b|
|000027d0| 79 74 65 20 69 6e 64 69 | 63 61 74 69 6e 67 20 74 |yte indi|cating t|
|000027e0| 68 65 20 6c 65 6e 67 74 | 68 20 6f 66 20 74 68 65 |he lengt|h of the|
|000027f0| 20 70 61 63 6b 65 74 2c | 20 61 6e 64 20 61 20 34 | packet,| and a 4|
|00002800| 2d 62 79 74 65 20 74 69 | 6d 65 2d 73 74 61 6d 70 |-byte ti|me-stamp|
|00002810| 2e 20 54 68 65 20 64 61 | 74 61 20 66 6f 6c 6c 6f |. The da|ta follo|
|00002820| 77 73 20 74 68 65 20 68 | 65 61 64 65 72 20 62 79 |ws the h|eader by|
|00002830| 74 65 73 2e 20 50 61 63 | 6b 65 74 73 20 6d 75 73 |tes. Pac|kets mus|
|00002840| 74 20 62 65 67 69 6e 20 | 61 74 20 77 6f 72 64 2d |t begin |at word-|
|00002850| 61 6c 69 67 6e 65 64 20 | 61 64 64 72 65 73 73 65 |aligned |addresse|
|00002860| 73 2e 0d 54 68 65 20 66 | 6c 61 67 73 20 62 79 74 |s..The f|lags byt|
|00002870| 65 20 69 6e 64 69 63 61 | 74 65 73 2c 20 61 6d 6f |e indica|tes, amo|
|00002880| 6e 67 20 6f 74 68 65 72 | 20 74 68 69 6e 67 73 2c |ng other| things,|
|00002890| 20 74 68 65 20 74 79 70 | 65 20 6f 66 20 74 68 65 | the typ|e of the|
|000028a0| 20 70 61 63 6b 65 74 2e | 20 54 68 65 20 74 77 6f | packet.| The two|
|000028b0| 20 70 61 63 6b 65 74 20 | 74 79 70 65 73 20 63 75 | packet |types cu|
|000028c0| 72 72 65 6e 74 6c 79 20 | 64 65 66 69 6e 65 64 20 |rrently |defined |
|000028d0| 61 72 65 20 74 68 65 20 | 4d 49 44 49 20 70 61 63 |are the |MIDI pac|
|000028e0| 6b 65 74 20 61 6e 64 20 | 74 68 65 20 4d 49 44 49 |ket and |the MIDI|
|000028f0| 20 4d 61 6e 61 67 65 72 | 20 6d 65 73 73 61 67 65 | Manager| message|
|00002900| 20 70 61 63 6b 65 74 2e | 20 41 20 4d 49 44 49 20 | packet.| A MIDI |
|00002910| 4d 61 6e 61 67 65 72 20 | 6d 65 73 73 61 67 65 20 |Manager |message |
|00002920| 69 73 20 75 73 65 64 20 | 74 6f 20 69 6e 66 6f 72 |is used |to infor|
|00002930| 6d 20 79 6f 75 72 20 61 | 70 70 6c 69 63 61 74 69 |m your a|pplicati|
|00002940| 6f 6e 20 6f 66 20 70 72 | 6f 62 6c 65 6d 73 20 73 |on of pr|oblems s|
|00002950| 75 63 68 20 61 73 20 62 | 75 66 66 65 72 20 6f 76 |uch as b|uffer ov|
|00002960| 65 72 66 6c 6f 77 20 65 | 72 72 6f 72 73 2e 0d 4d |erflow e|rrors..M|
|00002970| 49 44 49 20 70 61 63 6b | 65 74 73 20 6e 6f 72 6d |IDI pack|ets norm|
|00002980| 61 6c 6c 79 20 63 6f 6e | 74 61 69 6e 20 61 20 73 |ally con|tain a s|
|00002990| 69 6e 67 6c 65 20 63 6f | 6d 70 6c 65 74 65 20 4d |ingle co|mplete M|
|000029a0| 49 44 49 20 6d 65 73 73 | 61 67 65 2e 20 4d 49 44 |IDI mess|age. MID|
|000029b0| 49 20 73 79 73 74 65 6d | 20 65 78 63 6c 75 73 69 |I system| exclusi|
|000029c0| 76 65 20 28 53 79 73 45 | 78 29 20 6d 65 73 73 61 |ve (SysE|x) messa|
|000029d0| 67 65 73 20 6d 61 79 20 | 62 65 20 73 70 6c 69 74 |ges may |be split|
|000029e0| 20 69 6e 74 6f 20 73 65 | 76 65 72 61 6c 20 73 65 | into se|veral se|
|000029f0| 71 75 65 6e 74 69 61 6c | 20 70 61 63 6b 65 74 73 |quential| packets|
|00002a00| 2e 20 49 6e 20 74 68 69 | 73 20 63 61 73 65 20 74 |. In thi|s case t|
|00002a10| 68 65 20 66 6c 61 67 73 | 20 69 6e 64 69 63 61 74 |he flags| indicat|
|00002a20| 65 20 74 68 61 74 20 64 | 61 74 61 20 69 6e 20 61 |e that d|ata in a|
|00002a30| 20 67 69 76 65 6e 20 70 | 61 63 6b 65 74 20 63 6f | given p|acket co|
|00002a40| 6e 74 69 6e 75 65 73 20 | 69 6e 20 66 6f 6c 6c 6f |ntinues |in follo|
|00002a50| 77 69 6e 67 20 70 61 63 | 6b 65 74 73 2e 0d 4d 49 |wing pac|kets..MI|
|00002a60| 44 49 20 6d 65 73 73 61 | 67 65 73 20 69 6e 20 70 |DI messa|ges in p|
|00002a70| 61 63 6b 65 74 73 20 61 | 72 65 20 22 73 61 6e 69 |ackets a|re "sani|
|00002a80| 74 69 7a 65 64 22 3b 20 | 74 68 61 74 20 69 73 2c |tized"; |that is,|
|00002a90| 20 61 20 4d 49 44 49 20 | 6d 65 73 73 61 67 65 20 | a MIDI |message |
|00002aa0| 61 6c 77 61 79 73 20 63 | 6f 6e 74 61 69 6e 20 61 |always c|ontain a|
|00002ab0| 20 73 74 61 74 75 73 20 | 62 79 74 65 20 65 76 65 | status |byte eve|
|00002ac0| 6e 20 69 66 20 74 68 65 | 20 6d 65 73 73 61 67 65 |n if the| message|
|00002ad0| 20 77 61 73 20 72 65 63 | 65 69 76 65 64 20 66 72 | was rec|eived fr|
|00002ae0| 6f 6d 20 61 6e 20 65 78 | 74 65 72 6e 61 6c 20 73 |om an ex|ternal s|
|00002af0| 79 6e 74 68 65 73 69 7a | 65 72 20 77 69 74 68 20 |ynthesiz|er with |
|00002b00| 74 68 65 20 73 74 61 74 | 75 73 20 62 79 74 65 20 |the stat|us byte |
|00002b10| 6f 6d 69 74 74 65 64 20 | 62 79 20 4d 49 44 49 20 |omitted |by MIDI |
|00002b20| 72 75 6e 6e 69 6e 67 20 | 73 74 61 74 75 73 20 6f |running |status o|
|00002b30| 70 74 69 6d 69 7a 61 74 | 69 6f 6e 2e 20 53 79 73 |ptimizat|ion. Sys|
|00002b40| 74 65 6d 20 65 78 63 6c | 75 73 69 76 65 20 63 6f |tem excl|usive co|
|00002b50| 6d 6d 61 6e 64 73 20 61 | 6c 77 61 79 73 20 65 6e |mmands a|lways en|
|00002b60| 64 20 77 69 74 68 20 61 | 6e 20 24 46 37 20 62 79 |d with a|n $F7 by|
|00002b70| 74 65 2e 20 52 65 61 6c | 2d 74 69 6d 65 20 6d 65 |te. Real|-time me|
|00002b80| 73 73 61 67 65 73 20 61 | 72 65 20 73 65 6e 74 20 |ssages a|re sent |
|00002b90| 69 6e 20 73 65 70 61 72 | 61 74 65 20 70 61 63 6b |in separ|ate pack|
|00002ba0| 65 74 73 20 61 6e 64 20 | 6e 65 76 65 72 20 69 6e |ets and |never in|
|00002bb0| 74 65 72 72 75 70 74 20 | 61 20 6e 6f 72 6d 61 6c |terrupt |a normal|
|00002bc0| 20 4d 49 44 49 20 6d 65 | 73 73 61 67 65 20 77 69 | MIDI me|ssage wi|
|00002bd0| 74 68 69 6e 20 61 20 70 | 61 63 6b 65 74 2e 20 59 |thin a p|acket. Y|
|00002be0| 6f 75 20 63 61 6e 20 63 | 6f 75 6e 74 20 6f 6e 20 |ou can c|ount on |
|00002bf0| 74 68 69 73 20 62 65 68 | 61 76 69 6f 72 20 77 68 |this beh|avior wh|
|00002c00| 65 6e 20 79 6f 75 72 20 | 61 70 70 6c 69 63 61 74 |en your |applicat|
|00002c10| 69 6f 6e 20 72 65 63 65 | 69 76 65 73 20 70 61 63 |ion rece|ives pac|
|00002c20| 6b 65 74 73 20 66 72 6f | 6d 20 74 68 65 20 4d 49 |kets fro|m the MI|
|00002c30| 44 49 20 4d 61 6e 61 67 | 65 72 2c 20 61 6e 64 20 |DI Manag|er, and |
|00002c40| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00002c50| 6d 75 73 74 20 6f 62 65 | 79 20 74 68 65 73 65 20 |must obe|y these |
|00002c60| 72 75 6c 65 73 20 77 68 | 65 6e 20 69 74 20 77 72 |rules wh|en it wr|
|00002c70| 69 74 65 73 20 4d 49 44 | 49 20 70 61 63 6b 65 74 |ites MID|I packet|
|00002c80| 73 2e 0d 52 65 61 64 69 | 6e 67 20 4d 49 44 49 20 |s..Readi|ng MIDI |
|00002c90| 64 61 74 61 0d 41 20 70 | 6f 72 74 20 72 65 63 65 |data.A p|ort rece|
|00002ca0| 69 76 65 73 20 69 74 73 | 20 64 61 74 61 20 74 68 |ives its| data th|
|00002cb0| 72 6f 75 67 68 20 69 74 | 73 20 72 65 61 64 48 6f |rough it|s readHo|
|00002cc0| 6f 6b 2e 20 49 66 20 74 | 68 65 20 72 65 61 64 48 |ok. If t|he readH|
|00002cd0| 6f 6f 6b 20 69 73 20 4e | 49 4c 20 74 68 65 6e 20 |ook is N|IL then |
|00002ce0| 74 68 65 20 70 61 63 6b | 65 74 73 20 61 72 65 20 |the pack|ets are |
|00002cf0| 6c 6f 73 74 2e 20 54 68 | 65 20 72 65 61 64 48 6f |lost. Th|e readHo|
|00002d00| 6f 6b 20 69 73 20 63 61 | 6c 6c 65 64 20 77 68 65 |ok is ca|lled whe|
|00002d10| 6e 20 74 68 65 20 74 69 | 6d 65 53 74 61 6d 70 20 |n the ti|meStamp |
|00002d20| 6f 66 20 61 20 70 61 63 | 6b 65 74 20 69 73 20 6c |of a pac|ket is l|
|00002d30| 65 73 73 20 74 68 61 6e | 20 74 68 65 20 73 75 6d |ess than| the sum|
|00002d40| 20 6f 66 20 74 68 65 20 | 70 6f 72 74 d5 73 20 63 | of the |port.s c|
|00002d50| 75 72 72 65 6e 74 20 74 | 69 6d 65 20 61 6e 64 20 |urrent t|ime and |
|00002d60| 6f 66 66 73 65 74 54 69 | 6d 65 2e 20 57 68 65 6e |offsetTi|me. When|
|00002d70| 20 74 68 69 73 20 63 6f | 6e 64 69 74 69 6f 6e 20 | this co|ndition |
|00002d80| 69 73 20 73 61 74 69 73 | 66 69 65 64 2c 20 74 68 |is satis|fied, th|
|00002d90| 65 20 70 61 63 6b 65 74 | 20 69 73 20 63 6f 6e 73 |e packet| is cons|
|00002da0| 69 64 65 72 65 64 20 63 | 75 72 72 65 6e 74 2e 20 |idered c|urrent. |
|00002db0| 0d 54 68 65 20 76 61 6c | 75 65 20 6f 66 20 6f 66 |.The val|ue of of|
|00002dc0| 66 73 65 74 54 69 6d 65 | 20 63 61 6e 20 62 65 20 |fsetTime| can be |
|00002dd0| 75 73 65 64 20 74 6f 20 | 65 6e 61 62 6c 65 20 61 |used to |enable a|
|00002de0| 6e 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 6f |n applic|ation to|
|00002df0| 20 72 65 61 64 20 4d 49 | 44 49 20 70 61 63 6b 65 | read MI|DI packe|
|00002e00| 74 73 20 61 74 20 61 20 | 70 61 73 74 20 6f 72 20 |ts at a |past or |
|00002e10| 66 75 74 75 72 65 20 74 | 69 6d 65 2c 20 66 6f 72 |future t|ime, for|
|00002e20| 20 65 78 61 6d 70 6c 65 | 20 69 6e 20 69 6d 70 6c | example| in impl|
|00002e30| 65 6d 65 6e 74 69 6e 67 | 20 61 20 4d 49 44 49 20 |ementing| a MIDI |
|00002e40| 64 65 6c 61 79 2e 20 49 | 66 20 6f 66 66 73 65 74 |delay. I|f offset|
|00002e50| 54 69 6d 65 20 69 73 20 | 61 20 6c 61 72 67 65 20 |Time is |a large |
|00002e60| 6e 65 67 61 74 69 76 65 | 20 6e 75 6d 62 65 72 20 |negative| number |
|00002e70| 74 68 65 6e 20 72 65 61 | 64 48 6f 6f 6b 20 77 69 |then rea|dHook wi|
|00002e80| 6c 6c 20 6e 65 76 65 72 | 20 62 65 20 63 61 6c 6c |ll never| be call|
|00002e90| 65 64 2e 20 41 20 63 6c | 69 65 6e 74 20 63 61 6e |ed. A cl|ient can|
|00002ea0| 20 62 65 20 61 73 73 75 | 72 65 64 20 6f 66 20 72 | be assu|red of r|
|00002eb0| 65 63 65 69 76 69 6e 67 | 20 61 6c 6c 20 64 61 74 |eceiving| all dat|
|00002ec0| 61 20 62 79 20 73 65 74 | 74 69 6e 67 20 6f 66 66 |a by set|ting off|
|00002ed0| 73 65 74 54 69 6d 65 20 | 74 6f 20 61 20 6c 61 72 |setTime |to a lar|
|00002ee0| 67 65 20 70 6f 73 69 74 | 69 76 65 20 76 61 6c 75 |ge posit|ive valu|
|00002ef0| 65 2e 20 54 68 72 65 65 | 20 63 6f 6e 73 74 61 6e |e. Three| constan|
|00002f00| 74 73 20 61 72 65 20 64 | 65 66 69 6e 65 64 20 66 |ts are d|efined f|
|00002f10| 6f 72 20 75 73 65 20 77 | 69 74 68 20 72 65 61 64 |or use w|ith read|
|00002f20| 48 6f 6f 6b 3a 20 6d 69 | 64 69 47 65 74 45 76 65 |Hook: mi|diGetEve|
|00002f30| 72 79 74 68 69 6e 67 20 | 69 73 20 61 20 6c 61 72 |rything |is a lar|
|00002f40| 67 65 20 70 6f 73 69 74 | 69 76 65 20 76 61 6c 75 |ge posit|ive valu|
|00002f50| 65 20 74 68 61 74 20 73 | 70 65 63 69 66 69 65 73 |e that s|pecifies|
|00002f60| 20 74 68 61 74 20 72 65 | 61 64 48 6f 6f 6b 20 73 | that re|adHook s|
|00002f70| 68 6f 75 6c 64 20 72 65 | 63 65 69 76 65 20 61 6c |hould re|ceive al|
|00002f80| 6c 20 64 61 74 61 3b 20 | 6d 69 64 69 47 65 74 4e |l data; |midiGetN|
|00002f90| 6f 74 68 69 6e 67 20 73 | 70 65 63 69 66 69 65 73 |othing s|pecifies|
|00002fa0| 20 74 68 61 74 20 72 65 | 61 64 48 6f 6f 6b 20 73 | that re|adHook s|
|00002fb0| 68 6f 75 6c 64 20 72 65 | 63 65 69 76 65 20 6e 6f |hould re|ceive no|
|00002fc0| 20 64 61 74 61 3b 20 6d | 69 64 69 47 65 74 43 75 | data; m|idiGetCu|
|00002fd0| 72 72 65 6e 74 20 65 6e | 61 62 6c 65 73 20 61 6e |rrent en|ables an|
|00002fe0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 74 6f 20 | applica|tion to |
|00002ff0| 67 65 74 20 64 61 74 61 | 20 61 74 20 74 68 65 20 |get data| at the |
|00003000| 74 69 6d 65 20 69 74 20 | 77 61 73 20 69 6e 74 65 |time it |was inte|
|00003010| 6e 64 65 64 20 74 6f 20 | 62 65 20 72 65 61 64 2e |nded to |be read.|
|00003020| 0d 72 65 61 64 48 6f 6f | 6b 20 6d 61 79 20 72 65 |.readHoo|k may re|
|00003030| 74 75 72 6e 20 61 6e 79 | 20 6f 66 20 74 68 72 65 |turn any| of thre|
|00003040| 65 20 72 65 73 75 6c 74 | 73 20 74 6f 20 74 68 65 |e result|s to the|
|00003050| 20 4d 49 44 49 20 4d 61 | 6e 61 67 65 72 3a 0d 31 | MIDI Ma|nager:.1|
|00003060| 29 09 6d 69 64 69 4b 65 | 65 70 50 61 63 6b 65 74 |).midiKe|epPacket|
|00003070| 09 54 68 65 20 63 75 72 | 72 65 6e 74 20 70 61 63 |.The cur|rent pac|
|00003080| 6b 65 74 20 69 73 20 70 | 6c 61 63 65 64 20 62 61 |ket is p|laced ba|
|00003090| 63 6b 20 69 6e 20 74 68 | 65 20 62 75 66 66 65 72 |ck in th|e buffer|
|000030a0| 20 61 6e 64 20 72 65 61 | 64 48 6f 6f 6b 20 69 73 | and rea|dHook is|
|000030b0| 20 6e 6f 74 20 63 61 6c | 6c 65 64 20 61 67 61 69 | not cal|led agai|
|000030c0| 6e 20 75 6e 74 69 6c 3a | 20 0d 09 09 28 6f 6e 65 |n until:| ...(one|
|000030d0| 20 6f 66 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e | of the |followin|
|000030e0| 67 3a 29 0d 09 a5 20 74 | 68 65 20 63 6c 6f 63 6b |g:)... t|he clock|
|000030f0| 20 74 69 63 6b 73 0d 09 | a5 20 6f 66 66 73 65 74 | ticks..|. offset|
|00003100| 54 69 6d 65 20 63 68 61 | 6e 67 65 73 0d 09 a5 20 |Time cha|nges... |
|00003110| 61 6e 6f 74 68 65 72 20 | 70 61 63 6b 65 74 20 69 |another |packet i|
|00003120| 73 20 72 65 63 65 69 76 | 65 64 0d 09 a5 20 74 68 |s receiv|ed... th|
|00003130| 65 20 4d 49 44 49 50 6f | 6c 6c 20 63 61 6c 6c 20 |e MIDIPo|ll call |
|00003140| 69 73 20 6d 61 64 65 0d | 32 29 09 6d 69 64 69 4d |is made.|2).midiM|
|00003150| 6f 72 65 50 61 63 6b 65 | 74 09 54 68 65 20 70 61 |orePacke|t.The pa|
|00003160| 63 6b 65 74 20 77 61 73 | 20 72 65 61 64 20 61 6e |cket was| read an|
|00003170| 64 20 72 65 6d 6f 76 65 | 64 20 66 72 6f 6d 20 74 |d remove|d from t|
|00003180| 68 65 20 62 75 66 66 65 | 72 2c 20 61 6e 64 20 72 |he buffe|r, and r|
|00003190| 65 61 64 48 6f 6f 6b 20 | 77 69 6c 6c 20 62 65 20 |eadHook |will be |
|000031a0| 63 61 6c 6c 65 64 20 77 | 69 74 68 20 61 6e 79 20 |called w|ith any |
|000031b0| 6f 74 68 65 72 20 63 75 | 72 72 65 6e 74 20 70 61 |other cu|rrent pa|
|000031c0| 63 6b 65 74 73 2e 0d 33 | 29 09 6d 69 64 69 4e 6f |ckets..3|).midiNo|
|000031d0| 4d 6f 72 65 50 61 63 6b | 65 74 20 20 20 54 68 65 |MorePack|et The|
|000031e0| 20 70 61 63 6b 65 74 20 | 77 61 73 20 72 65 61 64 | packet |was read|
|000031f0| 20 61 6e 64 20 72 65 6d | 6f 76 65 64 20 66 72 6f | and rem|oved fro|
|00003200| 6d 20 74 68 65 20 62 75 | 66 66 65 72 2c 20 62 75 |m the bu|ffer, bu|
|00003210| 74 20 74 68 65 20 72 65 | 61 64 48 6f 6f 6b 20 69 |t the re|adHook i|
|00003220| 73 20 6e 6f 74 20 63 61 | 6c 6c 65 64 20 61 67 61 |s not ca|lled aga|
|00003230| 69 6e 20 75 6e 74 69 6c | 3a 0d 20 09 09 28 6f 6e |in until|:. ..(on|
|00003240| 65 20 6f 66 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |e of the| followi|
|00003250| 6e 67 3a 29 0d 09 a5 20 | 74 68 65 20 63 6c 6f 63 |ng:)... |the cloc|
|00003260| 6b 20 74 69 63 6b 73 0d | 09 a5 20 6f 66 66 73 65 |k ticks.|.. offse|
|00003270| 74 54 69 6d 65 20 63 68 | 61 6e 67 65 73 0d 09 a5 |tTime ch|anges...|
|00003280| 20 61 6e 6f 74 68 65 72 | 20 70 61 63 6b 65 74 20 | another| packet |
|00003290| 69 73 20 72 65 63 65 69 | 76 65 64 0d 09 a5 20 74 |is recei|ved... t|
|000032a0| 68 65 20 4d 49 44 49 50 | 6f 6c 6c 20 63 61 6c 6c |he MIDIP|oll call|
|000032b0| 20 69 73 20 6d 61 64 65 | 0d 4e 6f 74 65 3a 20 72 | is made|.Note: r|
|000032c0| 65 61 64 48 6f 6f 6b 20 | 6d 61 79 20 62 65 20 63 |eadHook |may be c|
|000032d0| 61 6c 6c 65 64 20 61 74 | 20 69 6e 74 65 72 72 75 |alled at| interru|
|000032e0| 70 74 20 6c 65 76 65 6c | 2e 0d 45 61 63 68 20 74 |pt level|..Each t|
|000032f0| 69 6d 65 20 72 65 61 64 | 48 6f 6f 6b 20 69 73 20 |ime read|Hook is |
|00003300| 63 61 6c 6c 65 64 2c 20 | 69 74 20 69 73 20 70 61 |called, |it is pa|
|00003310| 73 73 65 64 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |ssed a p|ointer t|
|00003320| 6f 20 74 68 65 20 70 61 | 63 6b 65 74 2e 20 54 68 |o the pa|cket. Th|
|00003330| 65 20 4d 49 44 49 20 4d | 61 6e 61 67 65 72 20 77 |e MIDI M|anager w|
|00003340| 69 6c 6c 20 72 65 70 65 | 61 74 65 64 6c 79 20 63 |ill repe|atedly c|
|00003350| 61 6c 6c 20 74 68 65 20 | 72 65 61 64 48 6f 6f 6b |all the |readHook|
|00003360| 20 75 6e 74 69 6c 20 74 | 68 65 72 65 20 61 72 65 | until t|here are|
|00003370| 20 6e 6f 20 6d 6f 72 65 | 20 63 75 72 72 65 6e 74 | no more| current|
|00003380| 20 70 61 63 6b 65 74 73 | 2e 0d 54 68 65 20 4d 49 | packets|..The MI|
|00003390| 44 49 20 4d 61 6e 61 67 | 65 72 20 6e 65 76 65 72 |DI Manag|er never|
|000033a0| 20 72 65 74 75 72 6e 73 | 20 70 61 72 74 69 61 6c | returns| partial|
|000033b0| 20 4d 49 44 49 20 6d 65 | 73 73 61 67 65 73 20 74 | MIDI me|ssages t|
|000033c0| 6f 20 63 6c 69 65 6e 74 | 73 2c 20 77 69 74 68 20 |o client|s, with |
|000033d0| 6f 6e 65 20 65 78 63 65 | 70 74 69 6f 6e 2e 20 53 |one exce|ption. S|
|000033e0| 79 73 74 65 6d 2d 65 78 | 63 6c 75 73 69 76 65 20 |ystem-ex|clusive |
|000033f0| 6d 65 73 73 61 67 65 73 | 20 6d 61 79 20 62 65 20 |messages| may be |
|00003400| 73 70 6c 69 74 20 61 63 | 72 6f 73 73 20 6d 75 6c |split ac|ross mul|
|00003410| 74 69 70 6c 65 20 70 61 | 63 6b 65 74 73 20 62 65 |tiple pa|ckets be|
|00003420| 63 61 75 73 65 20 6f 66 | 20 74 68 65 69 72 20 76 |cause of| their v|
|00003430| 61 72 69 61 62 6c 65 20 | 73 69 7a 65 2e 20 0d 57 |ariable |size. .W|
|00003440| 68 65 6e 20 6d 75 6c 74 | 69 70 6c 65 20 70 61 63 |hen mult|iple pac|
|00003450| 6b 65 74 73 20 61 72 65 | 20 61 76 61 69 6c 61 62 |kets are| availab|
|00003460| 6c 65 20 69 6e 20 74 68 | 65 20 62 75 66 66 65 72 |le in th|e buffer|
|00003470| 20 61 73 73 6f 63 69 61 | 74 65 64 20 77 69 74 68 | associa|ted with|
|00003480| 20 61 6e 20 69 6e 70 75 | 74 20 70 6f 72 74 2c 20 | an inpu|t port, |
|00003490| 74 68 65 79 20 61 72 65 | 20 73 6f 72 74 65 64 20 |they are| sorted |
|000034a0| 61 6e 64 20 70 61 73 73 | 65 64 20 74 6f 20 74 68 |and pass|ed to th|
|000034b0| 65 20 72 65 61 64 48 6f | 6f 6b 20 69 6e 20 61 73 |e readHo|ok in as|
|000034c0| 63 65 6e 64 69 6e 67 20 | 6f 72 64 65 72 20 6f 66 |cending |order of|
|000034d0| 20 74 69 6d 65 20 73 74 | 61 6d 70 73 2e 20 20 54 | time st|amps. T|
|000034e0| 68 69 73 20 64 6f 65 73 | 20 6e 6f 74 20 6d 65 61 |his does| not mea|
|000034f0| 6e 20 74 68 61 74 20 70 | 61 63 6b 65 74 73 20 72 |n that p|ackets r|
|00003500| 65 63 65 69 76 65 64 20 | 62 79 20 74 68 65 20 72 |eceived |by the r|
|00003510| 65 61 64 48 6f 6f 6b 20 | 61 72 65 20 61 6c 77 61 |eadHook |are alwa|
|00003520| 79 73 20 6e 65 63 65 73 | 73 61 72 69 6c 79 20 69 |ys neces|sarily i|
|00003530| 6e 20 61 73 63 65 6e 64 | 69 6e 67 20 74 69 6d 65 |n ascend|ing time|
|00003540| 20 6f 72 64 65 72 2e 20 | 20 46 6f 72 20 65 78 61 | order. | For exa|
|00003550| 6d 70 6c 65 2c 20 69 74 | 20 69 73 20 70 6f 73 73 |mple, it| is poss|
|00003560| 69 62 6c 65 20 66 6f 72 | 20 74 68 65 20 72 65 61 |ible for| the rea|
|00003570| 64 48 6f 6f 6b 20 74 6f | 20 72 65 61 64 20 61 20 |dHook to| read a |
|00003580| 70 61 63 6b 65 74 20 77 | 69 74 68 20 74 69 6d 65 |packet w|ith time|
|00003590| 20 73 74 61 6d 70 20 32 | 30 2c 20 61 6e 64 20 74 | stamp 2|0, and t|
|000035a0| 68 65 6e 20 66 6f 72 20 | 61 20 70 61 63 6b 65 74 |hen for |a packet|
|000035b0| 20 74 6f 20 62 65 20 70 | 6c 61 63 65 64 20 69 6e | to be p|laced in|
|000035c0| 20 74 68 65 20 62 75 66 | 66 65 72 20 77 69 74 68 | the buf|fer with|
|000035d0| 20 61 20 74 69 6d 65 73 | 74 61 6d 70 20 6f 66 20 | a times|tamp of |
|000035e0| 31 35 2e 20 20 49 66 20 | 74 68 65 73 65 20 70 61 |15. If |these pa|
|000035f0| 63 6b 65 74 73 20 77 65 | 72 65 20 69 6e 20 74 68 |ckets we|re in th|
|00003600| 65 20 69 6e 70 75 74 20 | 62 75 66 66 65 72 20 73 |e input |buffer s|
|00003610| 69 6d 75 6c 74 61 6e 65 | 6f 75 73 6c 79 2c 20 68 |imultane|ously, h|
|00003620| 6f 77 65 76 65 72 2c 20 | 74 68 65 20 6f 6e 65 20 |owever, |the one |
|00003630| 77 69 74 68 20 74 68 65 | 20 6c 65 73 73 65 72 20 |with the| lesser |
|00003640| 74 69 6d 65 73 74 61 6d | 70 20 77 6f 75 6c 64 20 |timestam|p would |
|00003650| 62 65 20 70 61 73 73 65 | 64 20 74 6f 20 74 68 65 |be passe|d to the|
|00003660| 20 72 65 61 64 48 6f 6f | 6b 20 66 69 72 73 74 2e | readHoo|k first.|
|00003670| 20 20 54 69 6d 65 20 73 | 6f 72 74 69 6e 67 20 6f | Time s|orting o|
|00003680| 66 20 6d 65 73 73 61 67 | 65 73 20 69 73 20 73 75 |f messag|es is su|
|00003690| 73 63 65 70 74 69 62 6c | 65 20 74 6f 20 72 6f 75 |sceptibl|e to rou|
|000036a0| 6e 64 2d 6f 66 66 20 65 | 72 72 6f 72 73 20 69 6e |nd-off e|rrors in|
|000036b0| 63 75 72 72 65 64 20 64 | 75 72 69 6e 67 20 74 69 |curred d|uring ti|
|000036c0| 6d 65 73 74 61 6d 70 20 | 63 6f 6e 76 65 72 73 69 |mestamp |conversi|
|000036d0| 6f 6e 20 69 66 20 74 68 | 65 20 64 61 74 61 20 70 |on if th|e data p|
|000036e0| 6f 72 74 27 73 20 74 69 | 6d 65 20 62 61 73 65 20 |ort's ti|me base |
|000036f0| 68 61 73 20 62 65 65 6e | 20 73 74 6f 70 70 65 64 |has been| stopped|
|00003700| 2e 20 20 49 6e 20 74 68 | 69 73 20 63 61 73 65 2c |. In th|is case,|
|00003710| 20 74 68 65 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 | the MID|I Manage|
|00003720| 72 20 6d 61 79 20 63 68 | 61 6e 67 65 20 74 68 65 |r may ch|ange the|
|00003730| 20 6f 72 64 65 72 20 6f | 66 20 6d 65 73 73 61 67 | order o|f messag|
|00003740| 65 73 2e 20 20 49 66 20 | 61 20 64 61 74 61 20 70 |es. If |a data p|
|00003750| 6f 72 74 20 68 61 73 20 | 6e 6f 20 74 69 6d 65 20 |ort has |no time |
|00003760| 62 61 73 65 2c 20 6d 65 | 73 73 61 67 65 73 20 61 |base, me|ssages a|
|00003770| 72 65 20 70 61 73 73 65 | 64 20 74 6f 20 74 68 65 |re passe|d to the|
|00003780| 20 72 65 61 64 48 6f 6f | 6b 20 69 6e 20 74 68 65 | readHoo|k in the|
|00003790| 20 6f 72 64 65 72 20 74 | 68 65 79 20 77 65 72 65 | order t|hey were|
|000037a0| 20 72 65 63 65 69 76 65 | 64 2c 20 72 65 67 61 72 | receive|d, regar|
|000037b0| 64 6c 65 73 73 20 6f 66 | 20 74 69 6d 65 73 74 61 |dless of| timesta|
|000037c0| 6d 70 20 76 61 6c 75 65 | 73 20 28 74 68 65 20 74 |mp value|s (the t|
|000037d0| 69 6d 65 73 74 61 6d 70 | 20 73 65 65 6e 20 62 79 |imestamp| seen by|
|000037e0| 20 74 68 65 20 72 65 61 | 64 48 6f 6f 6b 20 77 69 | the rea|dHook wi|
|000037f0| 6c 6c 20 61 6c 77 61 79 | 73 20 62 65 20 30 20 69 |ll alway|s be 0 i|
|00003800| 6e 20 74 68 69 73 20 63 | 61 73 65 29 2e 20 0d 57 |n this c|ase). .W|
|00003810| 72 69 74 69 6e 67 20 4d | 49 44 49 20 64 61 74 61 |riting M|IDI data|
|00003820| 0d 57 68 65 6e 20 61 20 | 63 6c 69 65 6e 74 20 77 |.When a |client w|
|00003830| 72 69 74 65 73 20 64 61 | 74 61 2c 20 69 74 20 73 |rites da|ta, it s|
|00003840| 75 70 70 6c 69 65 73 20 | 61 20 70 61 63 6b 61 67 |upplies |a packag|
|00003850| 65 20 74 68 61 74 20 63 | 6f 6e 74 61 69 6e 73 20 |e that c|ontains |
|00003860| 61 20 68 65 61 64 65 72 | 20 63 6f 6e 73 69 73 74 |a header| consist|
|00003870| 69 6e 67 20 6f 66 20 66 | 6c 61 67 73 2c 20 6c 65 |ing of f|lags, le|
|00003880| 6e 67 74 68 2c 20 61 6e | 64 20 61 20 74 69 6d 65 |ngth, an|d a time|
|00003890| 20 73 74 61 6d 70 20 66 | 6f 6c 6c 6f 77 65 64 20 | stamp f|ollowed |
|000038a0| 62 79 20 6f 6e 65 20 6f | 72 20 6d 6f 72 65 20 4d |by one o|r more M|
|000038b0| 49 44 49 20 6d 65 73 73 | 61 67 65 73 2e 20 20 0d |IDI mess|ages. .|
|000038c0| 46 69 67 75 72 65 20 31 | 3a 20 4d 49 44 49 20 70 |Figure 1|: MIDI p|
|000038d0| 61 63 6b 65 74 20 66 6f | 72 6d 61 74 0d 54 68 65 |acket fo|rmat.The|
|000038e0| 20 4d 49 44 49 20 4d 61 | 6e 61 67 65 72 20 61 6c | MIDI Ma|nager al|
|000038f0| 77 61 79 73 20 77 72 69 | 74 65 73 20 70 61 63 6b |ways wri|tes pack|
|00003900| 65 74 73 20 69 6d 6d 65 | 64 69 61 74 65 6c 79 2e |ets imme|diately.|
|00003910| 20 54 68 65 20 70 61 63 | 6b 65 74 27 73 20 66 69 | The pac|ket's fi|
|00003920| 6e 61 6c 20 74 69 6d 65 | 20 73 74 61 6d 70 2c 20 |nal time| stamp, |
|00003930| 61 73 20 73 65 65 6e 20 | 62 79 20 74 68 65 20 64 |as seen |by the d|
|00003940| 65 73 74 69 6e 61 74 69 | 6f 6e 20 70 6f 72 74 2c |estinati|on port,|
|00003950| 20 64 65 70 65 6e 64 73 | 20 6f 6e 20 74 68 65 20 | depends| on the |
|00003960| 73 74 61 74 65 20 6f 66 | 20 62 69 74 20 37 20 6f |state of| bit 7 o|
|00003970| 66 20 74 68 65 20 70 61 | 63 6b 65 74 20 66 6c 61 |f the pa|cket fla|
|00003980| 67 73 2e 20 0d 49 66 20 | 62 69 74 20 37 20 69 73 |gs. .If |bit 7 is|
|00003990| 20 63 6c 65 61 72 2c 20 | 74 68 65 20 4d 49 44 49 | clear, |the MIDI|
|000039a0| 20 4d 61 6e 61 67 65 72 | 20 63 61 6c 63 75 6c 61 | Manager| calcula|
|000039b0| 74 65 73 20 61 6e 20 6f | 66 66 73 65 74 20 62 65 |tes an o|ffset be|
|000039c0| 74 77 65 65 6e 20 74 68 | 65 20 74 69 6d 65 20 73 |tween th|e time s|
|000039d0| 74 61 6d 70 20 61 6e 64 | 20 74 68 65 20 63 75 72 |tamp and| the cur|
|000039e0| 72 65 6e 74 20 6c 6f 63 | 61 6c 20 74 69 6d 65 20 |rent loc|al time |
|000039f0| 6f 66 20 74 68 65 20 6f | 75 74 70 75 74 20 70 6f |of the o|utput po|
|00003a00| 72 74 2e 20 20 54 68 65 | 20 66 69 6e 61 6c 20 74 |rt. The| final t|
|00003a10| 69 6d 65 20 73 74 61 6d | 70 20 69 73 20 63 6f 6d |ime stam|p is com|
|00003a20| 70 75 74 65 64 20 62 79 | 20 61 64 64 69 6e 67 20 |puted by| adding |
|00003a30| 74 68 69 73 20 6f 66 66 | 73 65 74 20 74 6f 20 74 |this off|set to t|
|00003a40| 68 65 20 63 75 72 72 65 | 6e 74 20 6c 6f 63 61 6c |he curre|nt local|
|00003a50| 20 74 69 6d 65 20 6f 66 | 20 74 68 65 20 64 65 73 | time of| the des|
|00003a60| 74 69 6e 61 74 69 6f 6e | 20 70 6f 72 74 2e 20 54 |tination| port. T|
|00003a70| 68 69 73 20 67 75 61 72 | 61 6e 74 65 65 73 20 74 |his guar|antees t|
|00003a80| 68 61 74 20 74 68 65 20 | 72 65 6c 61 74 69 6f 6e |hat the |relation|
|00003a90| 73 68 69 70 20 62 65 74 | 77 65 65 6e 20 74 68 65 |ship bet|ween the|
|00003aa0| 20 70 61 63 6b 65 74 27 | 73 20 74 69 6d 65 20 73 | packet'|s time s|
|00003ab0| 74 61 6d 70 20 61 6e 64 | 20 6c 6f 63 61 6c 20 74 |tamp and| local t|
|00003ac0| 69 6d 65 20 69 73 20 70 | 72 65 73 65 72 76 65 64 |ime is p|reserved|
|00003ad0| 2c 20 65 76 65 6e 20 74 | 68 6f 75 67 68 20 74 68 |, even t|hough th|
|00003ae0| 65 20 63 75 72 72 65 6e | 74 20 6c 6f 63 61 6c 20 |e curren|t local |
|00003af0| 74 69 6d 65 20 6d 61 79 | 20 64 69 66 66 65 72 20 |time may| differ |
|00003b00| 62 65 74 77 65 65 6e 20 | 74 68 65 20 73 6f 75 72 |between |the sour|
|00003b10| 63 65 20 61 6e 64 20 64 | 65 73 74 69 6e 61 74 69 |ce and d|estinati|
|00003b20| 6f 6e 20 70 6f 72 74 73 | 2e 0d 45 78 61 6d 70 6c |on ports|..Exampl|
|00003b30| 65 3a 20 0d 54 68 65 20 | 74 69 6d 65 73 74 61 6d |e: .The |timestam|
|00003b40| 70 20 6f 66 20 4d 49 44 | 49 20 6d 65 73 73 61 67 |p of MID|I messag|
|00003b50| 65 20 31 20 69 73 20 20 | 30 33 3a 31 30 2e 30 20 |e 1 is |03:10.0 |
|00003b60| 61 6e 64 20 69 74 20 69 | 73 20 77 72 69 74 74 65 |and it i|s writte|
|00003b70| 6e 20 61 74 20 30 33 3a | 30 30 2e 30 2e 20 54 68 |n at 03:|00.0. Th|
|00003b80| 65 20 63 75 72 72 65 6e | 74 20 6c 6f 63 61 6c 20 |e curren|t local |
|00003b90| 74 69 6d 65 20 61 74 20 | 74 68 65 20 64 65 73 74 |time at |the dest|
|00003ba0| 69 6e 61 74 69 6f 6e 20 | 70 6f 72 74 20 69 73 20 |ination |port is |
|00003bb0| 30 34 3a 3a 30 30 2e 30 | 2e 20 49 66 20 74 68 65 |04::00.0|. If the|
|00003bc0| 20 70 61 63 6b 65 74 20 | 69 73 20 73 74 61 6d 70 | packet |is stamp|
|00003bd0| 65 64 20 77 69 74 68 20 | 74 68 65 20 6c 6f 63 61 |ed with |the loca|
|00003be0| 6c 20 74 69 6d 65 20 6f | 66 20 74 68 65 20 64 65 |l time o|f the de|
|00003bf0| 73 74 69 6e 61 74 69 6f | 6e 20 74 68 65 6e 20 74 |stinatio|n then t|
|00003c00| 68 65 20 72 65 6c 61 74 | 69 6f 6e 73 68 69 70 20 |he relat|ionship |
|00003c10| 62 65 74 77 65 65 6e 20 | 74 68 61 74 20 74 69 6d |between |that tim|
|00003c20| 65 20 73 74 61 6d 70 20 | 61 6e 64 20 6c 6f 63 61 |e stamp |and loca|
|00003c30| 6c 20 74 69 6d 65 20 68 | 61 73 20 63 68 61 6e 67 |l time h|as chang|
|00003c40| 65 64 2e 20 20 54 68 65 | 20 64 69 66 66 65 72 65 |ed. The| differe|
|00003c50| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 74 68 65 20 |nce betw|een the |
|00003c60| 74 69 6d 65 20 73 74 61 | 6d 70 20 61 6e 64 20 74 |time sta|mp and t|
|00003c70| 68 65 20 73 6f 75 72 63 | 65 20 70 6f 72 74 27 73 |he sourc|e port's|
|00003c80| 20 6c 6f 63 61 6c 20 74 | 69 6d 65 20 69 73 20 30 | local t|ime is 0|
|00003c90| 30 3a 31 30 2e 30 2e 20 | 54 6f 20 70 72 65 73 65 |0:10.0. |To prese|
|00003ca0| 72 76 65 20 74 68 69 73 | 20 72 65 6c 61 74 69 6f |rve this| relatio|
|00003cb0| 6e 73 68 69 70 2c 20 77 | 65 20 68 61 76 65 20 74 |nship, w|e have t|
|00003cc0| 6f 20 61 64 64 20 30 30 | 3a 31 30 2e 30 20 74 6f |o add 00|:10.0 to|
|00003cd0| 20 74 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | the des|tination|
|00003ce0| 27 73 20 6c 6f 63 61 6c | 20 74 69 6d 65 2c 20 67 |'s local| time, g|
|00003cf0| 69 76 69 6e 67 20 74 68 | 65 20 70 61 63 6b 65 74 |iving th|e packet|
|00003d00| 20 61 20 66 69 6e 61 6c | 20 74 69 6d 65 20 73 74 | a final| time st|
|00003d10| 61 6d 70 20 6f 66 20 30 | 34 3a 31 30 2e 30 2e 20 |amp of 0|4:10.0. |
|00003d20| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 20 61 63 |Note tha|t the ac|
|00003d30| 74 75 61 6c 20 74 69 6d | 65 20 61 74 20 77 68 69 |tual tim|e at whi|
|00003d40| 63 68 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |ch the d|estinati|
|00003d50| 6f 6e 20 70 6f 72 74 27 | 73 20 72 65 61 64 48 6f |on port'|s readHo|
|00003d60| 6f 6b 20 69 73 20 63 61 | 6c 6c 65 64 20 64 65 70 |ok is ca|lled dep|
|00003d70| 65 6e 64 73 20 6f 6e 20 | 74 68 65 20 76 61 6c 75 |ends on |the valu|
|00003d80| 65 20 6f 66 20 74 68 65 | 20 64 65 73 74 69 6e 61 |e of the| destina|
|00003d90| 74 69 6f 6e 27 73 20 6f | 66 66 73 65 74 54 69 6d |tion's o|ffsetTim|
|00003da0| 65 2e 20 49 74 20 6d 61 | 79 20 62 65 20 65 61 72 |e. It ma|y be ear|
|00003db0| 6c 69 65 72 20 6f 72 20 | 6c 61 74 65 72 20 74 68 |lier or |later th|
|00003dc0| 61 6e 20 30 34 3a 31 30 | 2e 30 2e 0d 20 0d 46 69 |an 04:10|.0.. .Fi|
|00003dd0| 67 75 72 65 20 32 3a 20 | 54 69 6d 65 20 73 74 61 |gure 2: |Time sta|
|00003de0| 6d 70 20 63 6f 6e 76 65 | 72 73 69 6f 6e 0d 49 66 |mp conve|rsion.If|
|00003df0| 20 62 69 74 20 37 20 6f | 66 20 74 68 65 20 66 6c | bit 7 o|f the fl|
|00003e00| 61 67 73 20 69 73 20 73 | 65 74 2c 20 74 68 65 6e |ags is s|et, then|
|00003e10| 20 74 68 65 20 74 68 65 | 20 63 75 72 72 65 6e 74 | the the| current|
|00003e20| 20 6c 6f 63 61 6c 20 74 | 69 6d 65 20 6f 66 20 74 | local t|ime of t|
|00003e30| 68 65 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 70 |he desti|nation p|
|00003e40| 6f 72 74 20 69 73 20 75 | 73 65 64 20 72 65 67 61 |ort is u|sed rega|
|00003e50| 72 64 6c 65 73 73 20 6f | 66 20 74 68 65 20 70 61 |rdless o|f the pa|
|00003e60| 63 6b 65 74 27 73 20 74 | 69 6d 65 20 73 74 61 6d |cket's t|ime stam|
|00003e70| 70 2e 20 49 6e 20 74 68 | 65 20 65 78 61 6d 70 6c |p. In th|e exampl|
|00003e80| 65 20 69 6c 6c 75 73 74 | 72 61 74 65 64 20 69 6e |e illust|rated in|
|00003e90| 20 66 69 67 75 72 65 20 | 32 2c 20 69 66 20 62 69 | figure |2, if bi|
|00003ea0| 74 20 37 20 6f 66 20 74 | 68 65 20 66 6c 61 67 73 |t 7 of t|he flags|
|00003eb0| 20 77 65 72 65 20 73 65 | 74 20 74 68 65 6e 20 74 | were se|t then t|
|00003ec0| 68 65 20 66 69 6e 61 6c | 20 74 69 6d 65 20 73 74 |he final| time st|
|00003ed0| 61 6d 70 20 6f 66 20 74 | 68 65 20 70 61 63 6b 65 |amp of t|he packe|
|00003ee0| 74 20 77 6f 75 6c 64 20 | 62 65 20 30 34 3a 30 30 |t would |be 04:00|
|00003ef0| 2e 30 2c 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |.0, the |current |
|00003f00| 6c 6f 63 61 6c 20 74 69 | 6d 65 20 66 6f 72 20 74 |local ti|me for t|
|00003f10| 68 65 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 2e 0d |he desti|nation..|
|00003f20| 54 69 6d 65 72 20 66 61 | 63 69 6c 69 74 69 65 73 |Timer fa|cilities|
|00003f30| 0d 54 68 65 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 |.The MID|I Manage|
|00003f40| 72 20 75 73 65 73 20 74 | 69 6d 65 20 70 6f 72 74 |r uses t|ime port|
|00003f50| 73 20 74 6f 20 73 74 61 | 6d 70 20 4d 49 44 49 20 |s to sta|mp MIDI |
|00003f60| 64 61 74 61 20 61 6e 64 | 20 74 6f 20 73 63 68 65 |data and| to sche|
|00003f70| 64 75 6c 65 20 70 65 72 | 69 6f 64 69 63 20 6f 72 |dule per|iodic or|
|00003f80| 20 6f 6e 65 2d 74 69 6d | 65 20 77 61 6b 65 2d 75 | one-tim|e wake-u|
|00003f90| 70 20 63 61 6c 6c 73 2e | 20 45 61 63 68 20 74 69 |p calls.| Each ti|
|00003fa0| 6d 65 20 70 6f 72 74 20 | 6d 61 79 20 62 65 20 73 |me port |may be s|
|00003fb0| 79 6e 63 68 72 6f 6e 69 | 7a 65 64 20 65 69 74 68 |ynchroni|zed eith|
|00003fc0| 65 72 20 69 6e 74 65 72 | 6e 61 6c 6c 79 20 6f 72 |er inter|nally or|
|00003fd0| 20 65 78 74 65 72 6e 61 | 6c 6c 79 2e 20 41 6e 20 | externa|lly. An |
|00003fe0| 69 6e 74 65 72 6e 61 6c | 6c 79 20 73 79 6e 63 68 |internal|ly synch|
|00003ff0| 72 6f 6e 69 7a 65 64 20 | 74 69 6d 65 20 70 6f 72 |ronized |time por|
|00004000| 74 20 73 69 6d 70 6c 79 | 20 72 75 6e 73 20 69 6e |t simply| runs in|
|00004010| 20 72 65 61 6c 20 74 69 | 6d 65 2c 20 62 65 67 69 | real ti|me, begi|
|00004020| 6e 6e 69 6e 67 20 77 68 | 65 6e 20 61 6e 20 61 70 |nning wh|en an ap|
|00004030| 70 6c 69 63 61 74 69 6f | 6e 20 73 74 61 72 74 73 |plicatio|n starts|
|00004040| 20 69 74 2e 20 41 6e 20 | 65 78 74 65 72 6e 61 6c | it. An |external|
|00004050| 6c 79 20 73 79 6e 63 68 | 72 6f 6e 69 7a 65 64 20 |ly synch|ronized |
|00004060| 74 69 6d 65 20 70 6f 72 | 74 20 74 69 63 6b 73 20 |time por|t ticks |
|00004070| 6f 6e 6c 79 20 77 68 65 | 6e 20 63 6f 6e 6e 65 63 |only whe|n connec|
|00004080| 74 65 64 20 74 6f 20 61 | 6e 6f 74 68 65 72 20 74 |ted to a|nother t|
|00004090| 69 6d 65 20 70 6f 72 74 | 20 74 68 61 74 20 69 73 |ime port| that is|
|000040a0| 20 72 75 6e 6e 69 6e 67 | 3b 20 69 74 20 74 69 63 | running|; it tic|
|000040b0| 6b 73 20 77 68 65 6e 20 | 74 68 65 20 70 6f 72 74 |ks when |the port|
|000040c0| 20 74 6f 20 77 68 69 63 | 68 20 69 74 20 69 73 20 | to whic|h it is |
|000040d0| 73 79 6e 63 68 72 6f 6e | 69 7a 65 64 20 74 69 63 |synchron|ized tic|
|000040e0| 6b 73 2e 20 53 75 63 68 | 20 61 20 70 6f 72 74 20 |ks. Such| a port |
|000040f0| 65 6e 61 62 6c 65 73 20 | 61 20 63 6c 69 65 6e 74 |enables |a client|
|00004100| 20 74 6f 20 73 79 6e 63 | 68 72 6f 6e 69 7a 65 20 | to sync|hronize |
|00004110| 74 6f 20 61 6e 6f 74 68 | 65 72 20 63 6c 69 65 6e |to anoth|er clien|
|00004120| 74 2c 20 6f 72 20 74 6f | 20 74 68 65 20 74 69 6d |t, or to| the tim|
|00004130| 65 20 62 61 73 65 73 20 | 73 75 70 70 6c 69 65 64 |e bases |supplied|
|00004140| 20 77 69 74 68 20 74 68 | 65 20 41 70 70 6c 65 20 | with th|e Apple |
|00004150| 4d 49 44 49 20 44 72 69 | 76 65 72 2e 20 53 79 6e |MIDI Dri|ver. Syn|
|00004160| 63 68 72 6f 6e 69 7a 61 | 74 69 6f 6e 20 74 6f 20 |chroniza|tion to |
|00004170| 74 68 65 20 74 69 6d 65 | 20 62 61 73 65 73 20 73 |the time| bases s|
|00004180| 75 70 70 6c 69 65 64 20 | 62 79 20 74 68 65 20 41 |upplied |by the A|
|00004190| 70 70 6c 65 20 4d 49 44 | 49 20 44 72 69 76 65 72 |pple MID|I Driver|
|000041a0| 20 6d 61 6b 65 73 20 69 | 74 20 65 61 73 79 20 74 | makes i|t easy t|
|000041b0| 6f 20 73 79 6e 63 68 72 | 6f 6e 69 7a 65 20 74 6f |o synchr|onize to|
|000041c0| 20 69 6e 63 6f 6d 69 6e | 67 20 4d 49 44 49 20 54 | incomin|g MIDI T|
|000041d0| 69 6d 65 20 43 6f 64 65 | 20 6f 72 20 4d 49 44 49 |ime Code| or MIDI|
|000041e0| 20 63 6c 6f 63 6b 73 2e | 20 0d 49 66 20 79 6f 75 | clocks.| .If you|
|000041f0| 20 77 61 6e 74 20 79 6f | 75 72 20 61 70 70 6c 69 | want yo|ur appli|
|00004200| 63 61 74 69 6f 6e 20 74 | 6f 20 61 6c 6c 6f 63 61 |cation t|o alloca|
|00004210| 74 65 20 61 6e 20 69 6e | 74 65 72 6e 61 6c 6c 79 |te an in|ternally|
|00004220| 20 73 79 6e 63 68 72 6f | 6e 69 7a 65 64 20 74 69 | synchro|nized ti|
|00004230| 6d 65 20 70 6f 72 74 20 | 74 68 61 74 20 6f 74 68 |me port |that oth|
|00004240| 65 72 20 70 6f 72 74 73 | 20 63 61 6e 6e 6f 74 20 |er ports| cannot |
|00004250| 63 6f 6e 6e 65 63 74 20 | 74 6f 20 74 68 65 6e 20 |connect |to then |
|00004260| 79 6f 75 20 63 61 6e 20 | 72 65 71 75 65 73 74 20 |you can |request |
|00004270| 61 6e 20 69 6e 76 69 73 | 69 62 6c 65 20 74 69 6d |an invis|ible tim|
|00004280| 65 20 70 6f 72 74 2e 20 | 49 6e 76 69 73 69 62 6c |e port. |Invisibl|
|00004290| 65 20 74 69 6d 65 20 70 | 6f 72 74 73 20 66 75 6e |e time p|orts fun|
|000042a0| 63 74 69 6f 6e 20 69 64 | 65 6e 74 69 63 61 6c 6c |ction id|enticall|
|000042b0| 79 20 74 6f 20 6f 74 68 | 65 72 20 74 79 70 65 20 |y to oth|er type |
|000042c0| 6f 66 20 74 69 6d 65 20 | 70 6f 72 74 73 2c 20 62 |of time |ports, b|
|000042d0| 75 74 20 50 61 74 63 68 | 42 61 79 20 64 6f 65 73 |ut Patch|Bay does|
|000042e0| 6e 27 74 20 64 69 73 70 | 6c 61 79 20 74 68 65 6d |n't disp|lay them|
|000042f0| 2e 20 54 68 69 73 20 63 | 68 61 72 61 63 74 65 72 |. This c|haracter|
|00004300| 69 73 74 69 63 20 70 72 | 65 76 65 6e 74 73 20 75 |istic pr|events u|
|00004310| 73 65 72 73 20 66 72 6f | 6d 20 63 6f 6e 6e 65 63 |sers fro|m connec|
|00004320| 74 69 6e 67 20 6f 74 68 | 65 72 20 70 6f 72 74 73 |ting oth|er ports|
|00004330| 20 74 6f 20 74 68 65 20 | 69 6e 76 69 73 69 62 6c | to the |invisibl|
|00004340| 65 20 74 69 6d 65 20 70 | 6f 72 74 73 2e 0d 54 69 |e time p|orts..Ti|
|00004350| 6d 65 72 20 66 6f 72 6d | 61 74 73 0d 54 68 65 20 |mer form|ats.The |
|00004360| 4d 49 44 49 20 4d 61 6e | 61 67 65 72 20 72 65 70 |MIDI Man|ager rep|
|00004370| 72 65 73 65 6e 74 73 20 | 74 69 6d 65 20 69 6e 20 |resents |time in |
|00004380| 61 6e 79 20 6f 66 20 74 | 68 65 20 66 6f 6c 6c 6f |any of t|he follo|
|00004390| 77 69 6e 67 20 66 6f 72 | 6d 61 74 73 2c 20 61 6e |wing for|mats, an|
|000043a0| 64 20 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 |d automa|tically |
|000043b0| 65 6e 73 75 72 65 73 20 | 74 68 61 74 20 61 20 70 |ensures |that a p|
|000043c0| 6f 72 74 20 72 65 63 65 | 69 76 65 73 20 74 69 6d |ort rece|ives tim|
|000043d0| 69 6e 67 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ing info|rmation |
|000043e0| 69 6e 20 69 74 73 20 6f | 77 6e 20 66 6f 72 6d 61 |in its o|wn forma|
|000043f0| 74 2e 0d a5 20 4d 69 6c | 6c 69 73 65 63 6f 6e 64 |t... Mil|lisecond|
|00004400| 73 09 54 68 65 20 74 69 | 6d 65 20 73 74 61 6d 70 |s.The ti|me stamp|
|00004410| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 72 61 | contain|s the ra|
|00004420| 77 20 6d 69 6c 6c 69 73 | 65 63 6f 6e 64 20 76 61 |w millis|econd va|
|00004430| 6c 75 65 20 72 65 61 64 | 20 66 72 6f 6d 20 74 68 |lue read| from th|
|00004440| 65 20 63 6c 69 65 6e 74 | d5 73 20 63 6c 6f 63 6b |e client|.s clock|
|00004450| 2e 20 49 6e 20 67 65 6e | 65 72 61 6c 2c 20 74 68 |. In gen|eral, th|
|00004460| 69 73 20 76 61 6c 75 65 | 20 69 73 20 74 68 65 20 |is value| is the |
|00004470| 6e 75 6d 62 65 72 20 6f | 66 20 6d 69 6c 6c 69 73 |number o|f millis|
|00004480| 65 63 6f 6e 64 73 20 74 | 68 61 74 20 68 61 76 65 |econds t|hat have|
|00004490| 20 65 6c 61 70 73 65 64 | 20 73 69 6e 63 65 20 74 | elapsed| since t|
|000044a0| 68 65 20 63 6c 69 65 6e | 74 d5 73 20 74 69 6d 65 |he clien|t.s time|
|000044b0| 20 62 61 73 65 20 73 74 | 61 72 74 65 64 2e 20 20 | base st|arted. |
|000044c0| 0d a5 20 42 65 61 74 73 | 09 49 6e 20 74 68 69 73 |.. Beats|.In this|
|000044d0| 20 66 6f 72 6d 61 74 20 | 74 68 65 20 74 69 6d 65 | format |the time|
|000044e0| 20 73 74 61 6d 70 20 63 | 6f 6e 74 61 69 6e 73 20 | stamp c|ontains |
|000044f0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 4d 49 |the numb|er of MI|
|00004500| 44 49 20 63 6c 6f 63 6b | 20 74 69 63 6b 73 20 72 |DI clock| ticks r|
|00004510| 65 63 65 69 76 65 64 20 | 73 69 6e 63 65 20 74 68 |eceived |since th|
|00004520| 65 20 63 6c 6f 63 6b 20 | 77 61 73 20 73 65 74 20 |e clock |was set |
|00004530| 74 6f 20 7a 65 72 6f 3b | 20 74 68 61 74 20 69 73 |to zero;| that is|
|00004540| 2c 20 6e 6f 72 6d 61 6c | 6c 79 2c 20 77 68 65 6e |, normal|ly, when|
|00004550| 20 69 74 20 77 61 73 20 | 73 74 61 72 74 65 64 2e | it was |started.|
|00004560| 20 41 6c 6c 20 6f 66 20 | 74 68 65 20 4d 49 44 49 | All of |the MIDI|
|00004570| 20 4d 61 6e 61 67 65 72 | d5 73 20 62 65 61 74 20 | Manager|.s beat |
|00004580| 63 61 6c 63 75 6c 61 74 | 69 6f 6e 73 20 61 72 65 |calculat|ions are|
|00004590| 20 62 61 73 65 64 20 6f | 6e 20 39 36 30 20 70 75 | based o|n 960 pu|
|000045a0| 6c 73 65 73 20 70 65 72 | 20 4d 49 44 49 20 71 75 |lses per| MIDI qu|
|000045b0| 61 72 74 65 72 20 6e 6f | 74 65 2e 20 54 68 65 20 |arter no|te. The |
|000045c0| 4d 49 44 49 20 4d 61 6e | 61 67 65 72 20 61 73 73 |MIDI Man|ager ass|
|000045d0| 75 6d 65 73 20 61 20 74 | 65 6d 70 6f 20 6f 66 20 |umes a t|empo of |
|000045e0| 31 32 35 20 62 65 61 74 | 73 20 70 65 72 20 6d 69 |125 beat|s per mi|
|000045f0| 6e 75 74 65 2e 20 0d a5 | 20 4d 49 44 49 20 54 69 |nute. ..| MIDI Ti|
|00004600| 6d 65 20 43 6f 64 65 09 | 49 6e 20 74 68 69 73 20 |me Code.|In this |
|00004610| 66 6f 72 6d 61 74 2c 20 | 74 68 65 20 74 69 6d 65 |format, |the time|
|00004620| 20 73 74 61 6d 70 20 63 | 6f 6e 74 61 69 6e 73 20 | stamp c|ontains |
|00004630| 74 68 65 20 72 61 77 20 | 6e 75 6d 62 65 72 20 6f |the raw |number o|
|00004640| 66 20 53 4d 50 54 45 20 | 62 69 74 73 20 28 38 30 |f SMPTE |bits (80|
|00004650| 20 70 65 72 20 66 72 61 | 6d 65 29 2e 20 28 53 4d | per fra|me). (SM|
|00004660| 50 54 45 20 73 74 61 6e | 64 73 20 66 6f 72 20 53 |PTE stan|ds for S|
|00004670| 6f 63 69 65 74 79 20 6f | 66 20 4d 6f 74 69 6f 6e |ociety o|f Motion|
|00004680| 20 50 69 63 74 75 72 65 | 20 61 6e 64 20 54 65 6c | Picture| and Tel|
|00004690| 65 76 69 73 69 6f 6e 20 | 45 6e 67 69 6e 65 65 72 |evision |Engineer|
|000046a0| 73 3b 20 74 68 65 20 73 | 74 61 6e 64 61 72 64 20 |s; the s|tandard |
|000046b0| 74 69 6d 65 20 63 6f 64 | 65 20 64 65 76 65 6c 6f |time cod|e develo|
|000046c0| 70 65 64 20 62 79 20 74 | 68 69 73 20 6f 72 67 61 |ped by t|his orga|
|000046d0| 6e 69 7a 61 74 69 6f 6e | 20 69 73 20 63 6f 6d 6d |nization| is comm|
|000046e0| 6f 6e 6c 79 20 72 65 66 | 65 72 72 65 64 20 74 6f |only ref|erred to|
|000046f0| 20 61 73 20 53 4d 50 54 | 45 20 54 69 6d 65 20 43 | as SMPT|E Time C|
|00004700| 6f 64 65 2c 20 6f 72 2c | 20 6d 6f 72 65 20 73 69 |ode, or,| more si|
|00004710| 6d 70 6c 79 2c 20 53 4d | 50 54 45 2e 29 20 54 68 |mply, SM|PTE.) Th|
|00004720| 69 73 20 63 61 6e 20 62 | 65 20 63 6f 6e 76 65 72 |is can b|e conver|
|00004730| 74 65 64 20 74 6f 20 74 | 68 65 20 66 6f 72 6d 61 |ted to t|he forma|
|00004740| 74 20 69 6e 20 66 69 67 | 75 72 65 20 33 20 75 73 |t in fig|ure 3 us|
|00004750| 69 6e 67 20 74 68 65 20 | 63 61 6c 6c 20 43 6f 6e |ing the |call Con|
|00004760| 76 65 72 74 54 69 6d 65 | 2e 20 4e 6f 74 65 20 74 |vertTime|. Note t|
|00004770| 68 61 74 20 74 68 65 72 | 65 20 69 73 20 73 6f 6d |hat ther|e is som|
|00004780| 65 20 72 6f 75 6e 64 69 | 6e 67 20 65 72 72 6f 72 |e roundi|ng error|
|00004790| 20 69 6e 68 65 72 65 6e | 74 20 69 6e 20 63 6f 6e | inheren|t in con|
|000047a0| 76 65 72 74 69 6e 67 20 | 20 66 72 6f 6d 20 72 61 |verting | from ra|
|000047b0| 77 20 62 69 74 73 20 74 | 6f 20 71 75 61 72 74 65 |w bits t|o quarte|
|000047c0| 72 20 66 72 61 6d 65 73 | 2e 20 0d 46 69 67 75 72 |r frames|. .Figur|
|000047d0| 65 20 33 3a 20 4d 49 44 | 49 20 54 69 6d 65 20 43 |e 3: MID|I Time C|
|000047e0| 6f 64 65 20 66 6f 72 6d | 61 74 0d 50 61 63 6b 65 |ode form|at.Packe|
|000047f0| 74 20 68 61 6e 64 6c 69 | 6e 67 0d 49 6e 20 65 76 |t handli|ng.In ev|
|00004800| 65 72 79 20 4d 49 44 49 | 20 70 61 63 6b 65 74 20 |ery MIDI| packet |
|00004810| 74 68 65 72 65 20 61 72 | 65 20 38 20 62 69 74 73 |there ar|e 8 bits|
|00004820| 20 6f 66 20 66 6c 61 67 | 73 2e 20 54 68 65 73 65 | of flag|s. These|
|00004830| 20 66 6c 61 67 73 20 63 | 6f 6e 74 61 69 6e 20 69 | flags c|ontain i|
|00004840| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 6e 65 63 65 73 |nformati|on neces|
|00004850| 73 61 72 79 20 66 6f 72 | 20 74 68 65 20 63 6f 72 |sary for| the cor|
|00004860| 72 65 63 74 20 69 6e 74 | 65 72 70 72 65 74 61 74 |rect int|erpretat|
|00004870| 69 6f 6e 20 6f 66 20 74 | 68 65 20 70 61 63 6b 65 |ion of t|he packe|
|00004880| 74 2e 20 46 6f 72 20 70 | 61 63 6b 65 74 73 20 63 |t. For p|ackets c|
|00004890| 6f 6e 74 61 69 6e 69 6e | 67 20 4d 49 44 49 20 63 |ontainin|g MIDI c|
|000048a0| 68 61 6e 6e 65 6c 20 76 | 6f 69 63 65 20 6d 65 73 |hannel v|oice mes|
|000048b0| 73 61 67 65 73 2c 20 74 | 68 65 20 75 73 75 61 6c |sages, t|he usual|
|000048c0| 20 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 66 6c | value o|f the fl|
|000048d0| 61 67 20 62 79 74 65 20 | 77 69 6c 6c 20 62 65 20 |ag byte |will be |
|000048e0| 30 2c 20 6d 61 6b 69 6e | 67 20 69 74 20 65 61 73 |0, makin|g it eas|
|000048f0| 79 20 74 6f 20 64 65 63 | 6f 64 65 20 74 68 65 20 |y to dec|ode the |
|00004900| 66 6c 61 67 73 2e 0d 6d | 69 64 69 54 69 6d 65 53 |flags..m|idiTimeS|
|00004910| 74 61 6d 70 56 61 6c 69 | 64 20 6f 72 20 6d 69 64 |tampVali|d or mid|
|00004920| 69 54 69 6d 65 53 74 61 | 6d 70 43 75 72 72 65 6e |iTimeSta|mpCurren|
|00004930| 74 20 20 69 73 20 63 6f | 6e 74 61 69 6e 65 64 20 |t is co|ntained |
|00004940| 69 6e 20 62 69 74 20 37 | 20 6f 66 20 74 68 65 20 |in bit 7| of the |
|00004950| 66 6c 61 67 20 62 79 74 | 65 2e 20 41 20 76 61 6c |flag byt|e. A val|
|00004960| 75 65 20 6f 66 20 30 20 | 73 70 65 63 69 66 69 65 |ue of 0 |specifie|
|00004970| 73 20 74 68 61 74 20 74 | 68 65 20 70 61 63 6b 65 |s that t|he packe|
|00004980| 74 d5 73 20 74 69 6d 65 | 20 73 74 61 6d 70 20 73 |t.s time| stamp s|
|00004990| 68 6f 75 6c 64 20 62 65 | 20 75 73 65 64 20 77 68 |hould be| used wh|
|000049a0| 65 6e 20 61 64 6a 75 73 | 74 69 6e 67 20 74 69 6d |en adjus|ting tim|
|000049b0| 65 20 73 74 61 6d 70 73 | 2c 20 61 6e 64 20 61 20 |e stamps|, and a |
|000049c0| 76 61 6c 75 65 20 6f 66 | 20 31 20 74 68 61 74 20 |value of| 1 that |
|000049d0| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|000049e0| 70 6f 72 74 d5 73 20 63 | 75 72 72 65 6e 74 20 74 |port.s c|urrent t|
|000049f0| 69 6d 65 20 73 68 6f 75 | 6c 64 20 62 65 20 75 73 |ime shou|ld be us|
|00004a00| 65 64 2e 20 0d 54 68 65 | 20 70 61 63 6b 65 74 20 |ed. .The| packet |
|00004a10| 74 79 70 65 20 69 73 20 | 63 6f 6e 74 61 69 6e 65 |type is |containe|
|00004a20| 64 20 69 6e 20 62 69 74 | 73 20 34 d0 36 20 6f 66 |d in bit|s 4.6 of|
|00004a30| 20 74 68 65 20 66 6c 61 | 67 20 62 79 74 65 2e 20 | the fla|g byte. |
|00004a40| 46 6f 72 20 4d 49 44 49 | 20 70 61 63 6b 65 74 73 |For MIDI| packets|
|00004a50| 2c 20 74 68 69 73 20 66 | 69 65 6c 64 20 77 69 6c |, this f|ield wil|
|00004a60| 6c 20 62 65 20 30 30 30 | 20 62 2e 20 41 20 76 61 |l be 000| b. A va|
|00004a70| 6c 75 65 20 6f 66 20 30 | 30 31 20 62 20 69 6e 64 |lue of 0|01 b ind|
|00004a80| 69 63 61 74 65 73 20 74 | 68 61 74 20 74 68 65 20 |icates t|hat the |
|00004a90| 70 61 63 6b 65 74 20 63 | 6f 6e 74 61 69 6e 73 20 |packet c|ontains |
|00004aa0| 61 20 6e 6f 6e 2d 4d 49 | 44 49 20 6d 65 73 73 61 |a non-MI|DI messa|
|00004ab0| 67 65 20 74 6f 20 6f 72 | 20 66 72 6f 6d 20 74 68 |ge to or| from th|
|00004ac0| 65 20 4d 49 44 49 20 4d | 61 6e 61 67 65 72 20 28 |e MIDI M|anager (|
|00004ad0| 64 65 70 65 6e 64 69 6e | 67 20 6f 6e 20 74 68 65 |dependin|g on the|
|00004ae0| 20 64 69 72 65 63 74 69 | 6f 6e 20 6f 66 20 74 68 | directi|on of th|
|00004af0| 65 20 70 6f 72 74 29 2e | 20 43 75 72 72 65 6e 74 |e port).| Current|
|00004b00| 6c 79 2c 20 74 68 65 20 | 6f 6e 6c 79 20 64 65 66 |ly, the |only def|
|00004b10| 69 6e 65 64 20 4d 49 44 | 49 20 4d 61 6e 61 67 65 |ined MID|I Manage|
|00004b20| 72 20 70 61 63 6b 65 74 | 73 20 61 72 65 20 62 75 |r packet|s are bu|
|00004b30| 66 66 65 72 20 6f 76 65 | 72 66 6c 6f 77 20 65 72 |ffer ove|rflow er|
|00004b40| 72 6f 72 73 20 61 6e 64 | 20 65 72 72 6f 72 73 20 |rors and| errors |
|00004b50| 66 72 6f 6d 20 74 68 65 | 20 4d 49 44 49 20 64 72 |from the| MIDI dr|
|00004b60| 69 76 65 72 2e 0d 4e 6f | 74 65 3a 20 46 6f 72 20 |iver..No|te: For |
|00004b70| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 77 69 |compatib|ility wi|
|00004b80| 74 68 20 66 75 74 75 72 | 65 20 76 65 72 73 69 6f |th futur|e versio|
|00004b90| 6e 73 20 6f 66 20 74 68 | 65 20 4d 49 44 49 20 4d |ns of th|e MIDI M|
|00004ba0| 61 6e 61 67 65 72 2c 20 | 63 6c 69 65 6e 74 73 20 |anager, |clients |
|00004bb0| 73 68 6f 75 6c 64 20 63 | 68 65 63 6b 20 74 68 65 |should c|heck the|
|00004bc0| 20 70 61 63 6b 65 74 20 | 74 79 70 65 20 6f 66 20 | packet |type of |
|00004bd0| 61 6c 6c 20 70 61 63 6b | 65 74 73 20 74 68 61 74 |all pack|ets that|
|00004be0| 20 74 68 65 79 20 72 65 | 63 65 69 76 65 2e 20 49 | they re|ceive. I|
|00004bf0| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00004c00| 6e 20 64 6f 65 73 6e 27 | 74 20 72 65 63 6f 67 6e |n doesn'|t recogn|
|00004c10| 69 7a 65 20 74 68 65 20 | 6d 65 73 73 61 67 65 20 |ize the |message |
|00004c20| 74 79 70 65 2c 20 74 68 | 65 6e 20 74 68 65 20 6d |type, th|en the m|
|00004c30| 65 73 73 61 67 65 20 73 | 68 6f 75 6c 64 20 62 65 |essage s|hould be|
|00004c40| 20 69 67 6e 6f 72 65 64 | 2e 20 0d 42 69 74 73 20 | ignored|. .Bits |
|00004c50| 30 2d 31 20 6f 66 20 74 | 68 65 20 66 6c 61 67 73 |0-1 of t|he flags|
|00004c60| 20 77 6f 72 64 20 63 6f | 6e 74 61 69 6e 20 69 6e | word co|ntain in|
|00004c70| 66 6f 72 6d 61 74 69 6f | 6e 20 72 65 67 61 72 64 |formatio|n regard|
|00004c80| 69 6e 67 20 63 6f 6e 74 | 69 6e 75 61 74 69 6f 6e |ing cont|inuation|
|00004c90| 20 70 61 63 6b 65 74 73 | 2e 20 54 68 69 73 20 66 | packets|. This f|
|00004ca0| 69 65 6c 64 20 77 69 6c | 6c 20 75 73 75 61 6c 6c |ield wil|l usuall|
|00004cb0| 79 20 62 65 20 30 30 2c | 20 73 69 6e 63 65 20 6d |y be 00,| since m|
|00004cc0| 6f 73 74 20 4d 49 44 49 | 20 69 6e 66 6f 72 6d 61 |ost MIDI| informa|
|00004cd0| 74 69 6f 6e 20 69 73 20 | 6e 6f 74 20 62 72 6f 6b |tion is |not brok|
|00004ce0| 65 6e 20 75 70 20 61 63 | 72 6f 73 73 20 6d 75 6c |en up ac|ross mul|
|00004cf0| 74 69 70 6c 65 20 70 61 | 63 6b 65 74 73 2e 20 4c |tiple pa|ckets. L|
|00004d00| 61 72 67 65 20 53 79 73 | 45 78 20 63 6f 6d 6d 61 |arge Sys|Ex comma|
|00004d10| 6e 64 73 20 77 69 6c 6c | 20 62 65 20 62 72 6f 6b |nds will| be brok|
|00004d20| 65 6e 20 75 70 20 61 63 | 72 6f 73 73 20 6d 75 6c |en up ac|ross mul|
|00004d30| 74 69 70 6c 65 20 70 61 | 63 6b 65 74 73 2c 20 73 |tiple pa|ckets, s|
|00004d40| 6f 20 63 68 65 63 6b 69 | 6e 67 20 74 68 65 73 65 |o checki|ng these|
|00004d50| 20 62 69 74 73 20 63 61 | 6e 20 62 65 20 63 72 69 | bits ca|n be cri|
|00004d60| 74 69 63 61 6c 20 74 6f | 20 74 68 65 20 63 6f 72 |tical to| the cor|
|00004d70| 72 65 63 74 20 69 6e 74 | 65 72 70 72 65 74 61 74 |rect int|erpretat|
|00004d80| 69 6f 6e 20 6f 66 20 61 | 20 6d 65 73 73 61 67 65 |ion of a| message|
|00004d90| 2e 20 0d 52 65 73 65 72 | 76 65 64 20 20 62 69 74 |. .Reser|ved bit|
|00004da0| 73 20 6d 75 73 74 20 62 | 65 20 30 20 75 70 6f 6e |s must b|e 0 upon|
|00004db0| 20 62 65 69 6e 67 20 77 | 72 69 74 74 65 6e 20 61 | being w|ritten a|
|00004dc0| 6e 64 20 73 68 6f 75 6c | 64 20 62 65 20 6d 61 73 |nd shoul|d be mas|
|00004dd0| 6b 65 64 20 77 68 65 6e | 20 72 65 61 64 2e 0d 46 |ked when| read..F|
|00004de0| 69 67 75 72 65 20 34 3a | 20 4d 49 44 49 20 50 61 |igure 4:| MIDI Pa|
|00004df0| 63 6b 65 74 20 66 6c 61 | 67 20 62 69 74 73 0d 4c |cket fla|g bits.L|
|00004e00| 65 6e 67 74 68 0d 54 68 | 65 20 6c 65 6e 67 74 68 |ength.Th|e length|
|00004e10| 20 62 79 74 65 20 64 65 | 73 69 67 6e 61 74 65 73 | byte de|signates|
|00004e20| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | the len|gth of t|
|00004e30| 68 65 20 70 61 63 6b 65 | 74 20 69 6e 20 62 79 74 |he packe|t in byt|
|00004e40| 65 73 2e 20 54 68 69 73 | 20 6c 69 6d 69 74 73 20 |es. This| limits |
|00004e50| 74 68 65 20 64 61 74 61 | 20 70 6f 72 74 69 6f 6e |the data| portion|
|00004e60| 20 6f 66 20 74 68 65 20 | 70 61 63 6b 65 74 20 74 | of the |packet t|
|00004e70| 6f 20 61 20 6c 65 6e 67 | 74 68 20 6f 66 20 32 34 |o a leng|th of 24|
|00004e80| 39 20 62 79 74 65 73 2e | 0d 41 70 70 6c 69 63 61 |9 bytes.|.Applica|
|00004e90| 74 69 6f 6e 73 0d 54 68 | 65 20 4d 49 44 49 20 4d |tions.Th|e MIDI M|
|00004ea0| 61 6e 61 67 65 6d 65 6e | 74 20 54 6f 6f 6c 73 20 |anagemen|t Tools |
|00004eb0| 64 69 73 6b 20 63 6f 6e | 74 61 69 6e 73 20 73 65 |disk con|tains se|
|00004ec0| 76 65 72 61 6c 20 73 61 | 6d 70 6c 65 20 61 70 70 |veral sa|mple app|
|00004ed0| 6c 69 63 61 74 69 6f 6e | 73 20 77 68 69 63 68 20 |lication|s which |
|00004ee0| 61 72 65 20 69 6e 63 6c | 75 64 65 64 20 74 6f 20 |are incl|uded to |
|00004ef0| 69 6c 6c 75 73 74 72 61 | 74 65 20 77 68 61 74 20 |illustra|te what |
|00004f00| 79 6f 75 20 63 61 6e 20 | 64 6f 20 77 69 74 68 20 |you can |do with |
|00004f10| 74 68 65 20 70 72 6f 76 | 69 64 65 64 20 74 6f 6f |the prov|ided too|
|00004f20| 6c 73 2e 20 20 54 68 65 | 73 65 20 61 70 70 6c 69 |ls. The|se appli|
|00004f30| 63 61 74 69 6f 6e 73 20 | 64 6f 20 6e 6f 74 20 6e |cations |do not n|
|00004f40| 65 63 65 73 73 61 72 69 | 6c 79 20 69 6c 6c 75 73 |ecessari|ly illus|
|00004f50| 74 72 61 74 65 20 74 68 | 65 20 62 65 73 74 20 77 |trate th|e best w|
|00004f60| 61 79 20 74 6f 20 61 63 | 63 6f 6d 70 6c 69 73 68 |ay to ac|complish|
|00004f70| 20 74 68 65 20 67 69 76 | 65 6e 20 74 61 73 6b 73 | the giv|en tasks|
|00004f80| 20 75 73 69 6e 67 20 74 | 68 65 20 4d 49 44 49 20 | using t|he MIDI |
|00004f90| 4d 61 6e 61 67 65 72 2e | 20 20 54 68 65 79 20 73 |Manager.| They s|
|00004fa0| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 75 73 65 |hould no|t be use|
|00004fb0| 64 20 61 73 20 65 78 61 | 6d 70 6c 65 73 20 6f 66 |d as exa|mples of|
|00004fc0| 20 68 6f 77 20 74 6f 20 | 77 72 69 74 65 20 4d 61 | how to |write Ma|
|00004fd0| 63 69 6e 74 6f 73 68 20 | 61 70 70 6c 69 63 61 74 |cintosh |applicat|
|00004fe0| 69 6f 6e 73 2e 0d 0d 4d | 49 44 49 20 4d 61 6e 61 |ions...M|IDI Mana|
|00004ff0| 67 65 72 20 43 61 6c 6c | 73 0d 54 68 65 20 66 6f |ger Call|s.The fo|
|00005000| 6c 6c 6f 77 69 6e 67 20 | 70 61 67 65 73 20 64 65 |llowing |pages de|
|00005010| 73 63 72 69 62 65 20 61 | 6c 6c 20 6f 66 20 74 68 |scribe a|ll of th|
|00005020| 65 20 66 75 6e 63 74 69 | 6f 6e 20 63 61 6c 6c 73 |e functi|on calls|
|00005030| 20 63 75 72 72 65 6e 74 | 6c 79 20 64 65 66 69 6e | current|ly defin|
|00005040| 65 64 20 66 6f 72 20 74 | 68 65 20 4d 49 44 49 20 |ed for t|he MIDI |
|00005050| 4d 61 6e 61 67 65 72 2e | 20 46 6f 72 20 65 61 63 |Manager.| For eac|
|00005060| 68 20 63 61 6c 6c 2c 20 | 61 20 64 65 73 63 72 69 |h call, |a descri|
|00005070| 70 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 66 75 6e |ption of| the fun|
|00005080| 63 74 69 6f 6e 20 69 73 | 20 73 75 70 70 6c 69 65 |ction is| supplie|
|00005090| 64 20 61 73 20 77 65 6c | 6c 20 61 73 20 61 20 64 |d as wel|l as a d|
|000050a0| 65 73 63 72 69 70 74 69 | 6f 6e 20 6f 66 20 74 68 |escripti|on of th|
|000050b0| 65 20 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |e data s|tructure|
|000050c0| 73 20 75 73 65 64 20 62 | 79 20 74 68 61 74 20 63 |s used b|y that c|
|000050d0| 61 6c 6c 2e 20 0d 54 68 | 65 20 64 65 63 6c 61 72 |all. .Th|e declar|
|000050e0| 61 74 69 6f 6e 20 6f 66 | 20 65 61 63 68 20 63 61 |ation of| each ca|
|000050f0| 6c 6c 20 69 73 20 66 6f | 6c 6c 6f 77 65 64 20 62 |ll is fo|llowed b|
|00005100| 79 20 61 20 6c 69 73 74 | 20 6f 66 20 74 68 65 20 |y a list| of the |
|00005110| 63 61 6c 6c d5 73 20 69 | 64 69 6f 73 79 6e 63 72 |call.s i|diosyncr|
|00005120| 61 73 69 65 73 2e 20 54 | 68 65 73 65 20 69 64 69 |asies. T|hese idi|
|00005130| 6f 73 79 6e 63 72 61 73 | 69 65 73 20 6d 61 79 20 |osyncras|ies may |
|00005140| 69 6e 63 6c 75 64 65 20 | 61 6e 79 20 6f 66 20 74 |include |any of t|
|00005150| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 3a 20 0d a5 |he follo|wing: ..|
|00005160| 09 74 68 65 20 63 61 6c | 6c 20 63 61 6e 20 62 65 |.the cal|l can be|
|00005170| 20 6d 61 64 65 20 66 72 | 6f 6d 20 61 6e 20 69 6e | made fr|om an in|
|00005180| 74 65 72 72 75 70 74 0d | a5 09 74 68 65 20 63 61 |terrupt.|..the ca|
|00005190| 6c 6c 20 6d 61 79 20 62 | 65 20 6d 61 64 65 20 62 |ll may b|e made b|
|000051a0| 79 20 74 68 65 20 63 6c | 69 65 6e 74 0d a5 09 74 |y the cl|ient...t|
|000051b0| 68 65 20 63 61 6c 6c 20 | 69 73 20 75 73 75 61 6c |he call |is usual|
|000051c0| 6c 79 20 6d 61 64 65 20 | 62 79 20 70 61 74 63 68 |ly made |by patch|
|000051d0| 65 72 73 20 6f 72 20 6f | 74 68 65 72 20 63 6c 69 |ers or o|ther cli|
|000051e0| 65 6e 74 73 0d a5 09 74 | 68 65 20 63 61 6c 6c 20 |ents...t|he call |
|000051f0| 69 73 20 75 73 65 66 75 | 6c 20 66 6f 72 20 74 69 |is usefu|l for ti|
|00005200| 6d 65 20 62 61 73 65 73 | 0d a5 09 74 68 65 20 63 |me bases|...the c|
|00005210| 61 6c 6c 20 69 73 20 75 | 73 65 66 75 6c 20 66 6f |all is u|seful fo|
|00005220| 72 20 64 61 74 61 20 70 | 6f 72 74 73 0d 54 68 65 |r data p|orts.The|
|00005230| 20 4d 49 44 49 20 4d 61 | 6e 61 67 65 72 20 75 73 | MIDI Ma|nager us|
|00005240| 65 73 20 61 20 6e 65 77 | 20 64 69 73 70 61 74 63 |es a new| dispatc|
|00005250| 68 20 6d 65 63 68 61 6e | 69 73 6d 20 74 68 61 74 |h mechan|ism that|
|00005260| 20 77 69 6c 6c 20 62 65 | 20 73 68 61 72 65 64 20 | will be| shared |
|00005270| 62 65 74 77 65 65 6e 20 | 74 68 65 20 4d 49 44 49 |between |the MIDI|
|00005280| 20 4d 61 6e 61 67 65 72 | 20 61 6e 64 20 66 75 74 | Manager| and fut|
|00005290| 75 72 65 20 73 6f 75 6e | 64 20 74 6f 6f 6c 73 20 |ure soun|d tools |
|000052a0| 64 65 76 65 6c 6f 70 65 | 64 20 62 79 20 41 70 70 |develope|d by App|
|000052b0| 6c 65 2e 20 20 54 68 69 | 73 20 6d 65 63 68 61 6e |le. Thi|s mechan|
|000052c0| 69 73 6d 20 70 72 6f 76 | 69 64 65 73 20 61 20 6d |ism prov|ides a m|
|000052d0| 65 74 68 6f 64 20 77 68 | 65 72 65 62 79 20 61 6e |ethod wh|ereby an|
|000052e0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 63 61 6e | applica|tion can|
|000052f0| 20 63 68 65 63 6b 20 66 | 6f 72 20 74 68 65 20 65 | check f|or the e|
|00005300| 78 69 73 74 65 6e 63 65 | 20 6f 66 20 61 20 73 6f |xistence| of a so|
|00005310| 75 6e 64 20 74 6f 6f 6c | 20 69 74 20 77 69 73 68 |und tool| it wish|
|00005320| 65 73 20 74 6f 20 75 73 | 65 2e 20 20 53 69 6e 63 |es to us|e. Sinc|
|00005330| 65 20 74 68 65 20 4d 49 | 44 49 20 4d 61 6e 61 67 |e the MI|DI Manag|
|00005340| 65 72 20 69 73 20 61 6e | 20 6f 70 74 69 6f 6e 61 |er is an| optiona|
|00005350| 6c 20 73 79 73 74 65 6d | 20 73 6f 66 74 77 61 72 |l system| softwar|
|00005360| 65 20 63 6f 6d 70 6f 6e | 65 6e 74 2c 20 61 70 70 |e compon|ent, app|
|00005370| 6c 69 63 61 74 69 6f 6e | 73 20 6d 75 73 74 20 63 |lication|s must c|
|00005380| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 69 |heck to |see if i|
|00005390| 74 20 69 73 20 69 6e 73 | 74 61 6c 6c 65 64 20 75 |t is ins|talled u|
|000053a0| 73 69 6e 67 20 74 68 65 | 20 53 6e 64 44 69 73 70 |sing the| SndDisp|
|000053b0| 56 65 72 73 69 6f 6e 20 | 63 61 6c 6c 20 62 65 66 |Version |call bef|
|000053c0| 6f 72 65 20 63 61 6c 6c | 69 6e 67 20 61 6e 79 20 |ore call|ing any |
|000053d0| 4d 49 44 49 20 4d 61 6e | 61 67 65 72 20 63 61 6c |MIDI Man|ager cal|
|000053e0| 6c 73 2e 20 0d 53 6e 64 | 44 69 73 70 56 65 72 73 |ls. .Snd|DispVers|
|000053f0| 69 6f 6e 0d 46 75 6e 63 | 74 69 6f 6e 20 53 6e 64 |ion.Func|tion Snd|
|00005400| 44 69 73 70 56 65 72 73 | 69 6f 6e 28 74 6f 6f 6c |DispVers|ion(tool|
|00005410| 4e 75 6d 20 3a 20 49 6e | 74 65 67 65 72 29 20 3a |Num : In|teger) :|
|00005420| 20 4c 4f 4e 47 49 4e 54 | 3b 0d 49 64 69 6f 73 79 | LONGINT|;.Idiosy|
|00005430| 6e 63 72 61 73 69 65 73 | 0d a5 09 74 68 65 20 63 |ncrasies|...the c|
|00005440| 61 6c 6c 20 63 61 6e 20 | 62 65 20 6d 61 64 65 20 |all can |be made |
|00005450| 66 72 6f 6d 20 61 6e 20 | 69 6e 74 65 72 72 75 70 |from an |interrup|
|00005460| 74 0d a5 09 74 68 65 20 | 63 61 6c 6c 20 6d 61 79 |t...the |call may|
|00005470| 20 62 65 20 6d 61 64 65 | 20 62 79 20 61 20 63 6c | be made| by a cl|
|00005480| 69 65 6e 74 0d a5 09 74 | 68 65 20 63 61 6c 6c 20 |ient...t|he call |
|00005490| 69 73 20 75 73 75 61 6c | 6c 79 20 6d 61 64 65 20 |is usual|ly made |
|000054a0| 62 79 20 70 61 74 63 68 | 65 72 73 20 6f 72 20 6f |by patch|ers or o|
|000054b0| 74 68 65 72 20 63 6c 69 | 65 6e 74 73 0d a5 09 74 |ther cli|ents...t|
|000054c0| 68 65 20 63 61 6c 6c 20 | 6d 75 73 74 20 62 65 20 |he call |must be |
|000054d0| 6d 61 64 65 20 62 65 66 | 6f 72 65 20 73 69 67 6e |made bef|ore sign|
|000054e0| 69 6e 67 20 69 6e 0d 54 | 68 69 73 20 66 75 6e 63 |ing in.T|his func|
|000054f0| 74 69 6f 6e 20 72 65 74 | 75 72 6e 73 20 74 68 65 |tion ret|urns the|
|00005500| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 65 20 | version| of the |
|00005510| 4d 49 44 49 20 4d 61 6e | 61 67 65 72 20 77 68 65 |MIDI Man|ager whe|
|00005520| 6e 20 63 61 6c 6c 65 64 | 20 77 69 74 68 20 74 6f |n called| with to|
|00005530| 6f 6c 4e 75 6d 20 3d 20 | 6d 69 64 69 54 6f 6f 6c |olNum = |midiTool|
|00005540| 4e 75 6d 20 3d 20 34 2e | 20 20 20 54 68 69 73 20 |Num = 4.| This |
|00005550| 63 61 6c 6c 20 6d 75 73 | 74 20 62 65 20 6d 61 64 |call mus|t be mad|
|00005560| 65 20 62 65 66 6f 72 65 | 20 74 68 65 20 66 69 72 |e before| the fir|
|00005570| 73 74 20 63 61 6c 6c 20 | 74 6f 20 4d 49 44 49 53 |st call |to MIDIS|
|00005580| 69 67 6e 49 6e 20 74 6f | 20 63 68 65 63 6b 20 69 |ignIn to| check i|
|00005590| 66 20 74 68 65 20 4d 49 | 44 49 20 4d 61 6e 61 67 |f the MI|DI Manag|
|000055a0| 65 72 20 68 61 73 20 62 | 65 65 6e 20 69 6e 73 74 |er has b|een inst|
|000055b0| 61 6c 6c 65 64 20 69 6e | 20 74 68 65 20 73 79 73 |alled in| the sys|
|000055c0| 74 65 6d 2e 20 20 53 6e | 64 44 69 73 70 56 65 72 |tem. Sn|dDispVer|
|000055d0| 73 69 6f 6e 20 72 65 74 | 75 72 6e 73 20 30 20 69 |sion ret|urns 0 i|
|000055e0| 66 20 74 68 65 20 4d 49 | 44 49 20 4d 61 6e 61 67 |f the MI|DI Manag|
|000055f0| 65 72 20 68 61 73 20 6e | 6f 74 20 62 65 65 6e 20 |er has n|ot been |
|00005600| 69 6e 73 74 61 6c 6c 65 | 64 2e 20 20 4f 74 68 65 |installe|d. Othe|
|00005610| 72 77 69 73 65 2c 20 74 | 68 65 20 76 65 72 73 69 |rwise, t|he versi|
|00005620| 6f 6e 20 72 65 74 75 72 | 6e 65 64 20 69 73 20 69 |on retur|ned is i|
|00005630| 6e 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 4d |n the st|andard M|
|00005640| 61 63 69 6e 74 6f 73 68 | 20 76 65 72 73 69 6f 6e |acintosh| version|
|00005650| 20 6e 75 6d 62 65 72 20 | 66 6f 72 6d 61 74 2e 0d | number |format..|
|00005660| 4d 49 44 49 53 69 67 6e | 49 6e 0d 46 75 6e 63 74 |MIDISign|In.Funct|
|00005670| 69 6f 6e 20 4d 49 44 49 | 53 69 67 6e 49 6e 28 63 |ion MIDI|SignIn(c|
|00005680| 6c 69 65 6e 74 49 44 3a | 20 4f 53 54 79 70 65 3b |lientID:| OSType;|
|00005690| 0d 72 65 66 43 6f 6e 3a | 20 4c 4f 4e 47 49 4e 54 |.refCon:| LONGINT|
|000056a0| 3b 0d 69 63 6f 6e 20 3a | 20 48 61 6e 64 6c 65 3b |;.icon :| Handle;|
|000056b0| 0d 6e 61 6d 65 3a 20 53 | 54 52 32 35 35 29 20 3a |.name: S|TR255) :|
|000056c0| 20 4f 53 45 72 72 3b 0d | 49 64 69 6f 73 79 6e 63 | OSErr;.|Idiosync|
|000056d0| 72 61 73 69 65 73 0d a5 | 09 74 68 65 20 63 61 6c |rasies..|.the cal|
|000056e0| 6c 20 6d 61 79 20 62 65 | 20 6d 61 64 65 20 62 79 |l may be| made by|
|000056f0| 20 61 20 63 6c 69 65 6e | 74 0d 54 68 69 73 20 63 | a clien|t.This c|
|00005700| 61 6c 6c 20 61 64 64 73 | 20 74 68 65 20 63 6c 69 |all adds| the cli|
|00005710| 65 6e 74 20 6d 61 6b 69 | 6e 67 20 74 68 65 20 63 |ent maki|ng the c|
|00005720| 61 6c 6c 20 74 6f 20 74 | 68 65 20 6c 69 73 74 20 |all to t|he list |
|00005730| 6f 66 20 63 6c 69 65 6e | 74 73 2e 0d 63 6c 69 65 |of clien|ts..clie|
|00005740| 6e 74 49 44 20 6d 75 73 | 74 20 62 65 20 75 6e 69 |ntID mus|t be uni|
|00005750| 71 75 65 20 61 63 72 6f | 73 73 20 61 6c 6c 20 63 |que acro|ss all c|
|00005760| 6c 69 65 6e 74 73 20 73 | 69 67 6e 65 64 20 69 6e |lients s|igned in|
|00005770| 74 6f 20 74 68 65 20 4d | 49 44 49 20 4d 61 6e 61 |to the M|IDI Mana|
|00005780| 67 65 72 2e 20 55 73 75 | 61 6c 6c 79 20 63 6c 69 |ger. Usu|ally cli|
|00005790| 65 6e 74 49 44 20 20 77 | 69 6c 6c 20 62 65 20 74 |entID w|ill be t|
|000057a0| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 73 |he appli|cation s|
|000057b0| 69 67 6e 61 74 75 72 65 | 20 6f 66 20 74 68 65 20 |ignature| of the |
|000057c0| 63 6c 69 65 6e 74 2e 20 | 54 68 65 20 72 65 66 43 |client. |The refC|
|000057d0| 6f 6e 20 69 73 20 61 20 | 34 20 62 79 74 65 20 66 |on is a |4 byte f|
|000057e0| 69 65 6c 64 20 61 76 61 | 69 6c 61 62 6c 65 20 66 |ield ava|ilable f|
|000057f0| 6f 72 20 75 73 65 20 62 | 79 20 74 68 65 20 63 6c |or use b|y the cl|
|00005800| 69 65 6e 74 2e 20 49 66 | 20 6d 6f 72 65 20 74 68 |ient. If| more th|
|00005810| 61 6e 20 34 20 62 79 74 | 65 73 20 6f 66 20 6d 65 |an 4 byt|es of me|
|00005820| 6d 6f 72 79 20 61 72 65 | 20 6e 65 65 64 65 64 20 |mory are| needed |
|00005830| 74 68 65 6e 20 74 68 65 | 20 72 65 66 43 6f 6e 20 |then the| refCon |
|00005840| 6d 61 79 20 62 65 20 75 | 73 65 64 20 74 6f 20 73 |may be u|sed to s|
|00005850| 74 6f 72 65 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |tore a p|ointer t|
|00005860| 6f 20 74 68 69 73 20 61 | 64 64 69 74 69 6f 6e 61 |o this a|dditiona|
|00005870| 6c 20 6d 65 6d 6f 72 79 | 2e 20 49 63 6f 6e 20 20 |l memory|. Icon |
|00005880| 69 73 20 74 68 65 20 68 | 61 6e 64 6c 65 20 6f 66 |is the h|andle of|
|00005890| 20 61 6e 20 69 63 6f 6e | 20 74 68 61 74 20 69 73 | an icon| that is|
|000058a0| 20 64 69 73 70 6c 61 79 | 65 64 20 69 6e 20 50 61 | display|ed in Pa|
|000058b0| 74 63 68 42 61 79 2e 20 | 20 4e 61 6d 65 20 69 73 |tchBay. | Name is|
|000058c0| 20 74 68 65 20 70 72 69 | 6e 74 20 6e 61 6d 65 20 | the pri|nt name |
|000058d0| 74 6f 20 62 65 20 75 73 | 65 64 20 66 6f 72 20 74 |to be us|ed for t|
|000058e0| 68 65 20 63 6c 69 65 6e | 74 20 69 6e 20 50 61 74 |he clien|t in Pat|
|000058f0| 63 68 42 61 79 2e 20 0d | 4e 6f 74 65 3a 20 53 6e |chBay. .|Note: Sn|
|00005900| 64 44 69 73 70 56 65 72 | 73 69 6f 6e 20 6d 75 73 |dDispVer|sion mus|
|00005910| 74 20 62 65 20 63 61 6c | 6c 65 64 20 74 6f 20 63 |t be cal|led to c|
|00005920| 68 65 63 6b 20 77 68 65 | 74 68 65 72 20 74 68 65 |heck whe|ther the|
|00005930| 20 4d 49 44 49 20 4d 61 | 6e 61 67 65 72 20 68 61 | MIDI Ma|nager ha|
|00005940| 73 20 62 65 65 6e 20 69 | 6e 73 74 61 6c 6c 65 64 |s been i|nstalled|
|00005950| 20 69 6e 20 74 68 65 20 | 73 79 73 74 65 6d 20 70 | in the |system p|
|00005960| 72 69 6f 72 20 74 6f 20 | 4d 49 44 49 53 69 67 6e |rior to |MIDISign|
|00005970| 49 6e 20 2e 0d 52 65 73 | 75 6c 74 20 63 6f 64 65 |In ..Res|ult code|
|00005980| 73 3a 0d 6e 6f 45 72 72 | 09 4e 6f 20 45 72 72 6f |s:.noErr|.No Erro|
|00005990| 72 0d 6d 65 6d 46 75 6c | 6c 45 72 72 09 4e 6f 74 |r.memFul|lErr.Not|
|000059a0| 20 65 6e 6f 75 67 68 20 | 72 6f 6f 6d 20 69 6e 20 | enough |room in |
|000059b0| 68 65 61 70 20 7a 6f 6e | 65 0d 64 75 70 49 44 45 |heap zon|e.dupIDE|
|000059c0| 72 72 09 41 20 63 6c 69 | 65 6e 74 20 68 61 73 20 |rr.A cli|ent has |
|000059d0| 61 6c 72 65 61 64 79 20 | 73 69 67 6e 65 64 20 69 |already |signed i|
|000059e0| 6e 20 77 69 74 68 20 74 | 68 61 74 20 49 44 0d 4d |n with t|hat ID.M|
|000059f0| 49 44 49 53 69 67 6e 4f | 75 74 0d 50 72 6f 63 65 |IDISignO|ut.Proce|
|00005a00| 64 75 72 65 20 4d 49 44 | 49 53 69 67 6e 4f 75 74 |dure MID|ISignOut|
|00005a10| 28 63 6c 69 65 6e 74 49 | 44 3a 20 4f 53 54 79 70 |(clientI|D: OSTyp|
|00005a20| 65 29 3b 0d 49 64 69 6f | 73 79 6e 63 72 61 73 69 |e);.Idio|syncrasi|
|00005a30| 65 73 0d a5 09 74 68 65 | 20 63 61 6c 6c 20 6d 61 |es...the| call ma|
|00005a40| 79 20 62 65 20 6d 61 64 | 65 20 62 79 20 61 20 63 |y be mad|e by a c|
|00005a50| 6c 69 65 6e 74 0d 54 68 | 69 73 20 63 61 6c 6c 20 |lient.Th|is call |
|00005a60| 77 69 6c 6c 20 72 65 6d | 6f 76 65 20 74 68 65 20 |will rem|ove the |
|00005a70| 63 6c 69 65 6e 74 20 63 | 6f 72 72 65 73 70 6f 6e |client c|orrespon|
|00005a80| 64 69 6e 67 20 74 6f 20 | 63 6c 69 65 6e 74 49 44 |ding to |clientID|
|00005a90| 20 66 72 6f 6d 20 74 68 | 65 20 4d 49 44 49 20 4d | from th|e MIDI M|
|00005aa0| 61 6e 61 67 65 72 2c 20 | 64 65 61 6c 6c 6f 63 61 |anager, |dealloca|
|00005ab0| 74 69 6e 67 20 61 6e 79 | 20 6d 65 6d 6f 72 79 20 |ting any| memory |
|00005ac0| 20 74 68 61 74 20 6d 61 | 79 20 68 61 76 65 20 62 | that ma|y have b|
|00005ad0| 65 65 6e 20 61 6c 6c 6f | 63 61 74 65 64 20 66 6f |een allo|cated fo|
|00005ae0| 72 20 74 68 61 74 20 63 | 6c 69 65 6e 74 20 61 6e |r that c|lient an|
|00005af0| 64 20 62 72 65 61 6b 69 | 6e 67 20 61 6e 79 20 63 |d breaki|ng any c|
|00005b00| 6f 6e 6e 65 63 74 69 6f | 6e 73 2e 20 41 6e 79 20 |onnectio|ns. Any |
|00005b10| 70 65 6e 64 69 6e 67 20 | 69 6e 70 75 74 20 6f 72 |pending |input or|
|00005b20| 20 6f 75 74 70 75 74 20 | 64 61 74 61 20 69 73 20 | output |data is |
|00005b30| 6c 6f 73 74 20 77 68 65 | 6e 20 74 68 69 73 20 63 |lost whe|n this c|
|00005b40| 61 6c 6c 20 69 73 20 6d | 61 64 65 2e 20 0d 4e 6f |all is m|ade. .No|
|00005b50| 74 65 3a 20 54 68 65 20 | 6f 6e 6c 79 20 63 61 6c |te: The |only cal|
|00005b60| 6c 73 20 74 68 61 74 20 | 61 72 65 20 6c 65 67 61 |ls that |are lega|
|00005b70| 6c 20 61 66 74 65 72 20 | 74 68 65 20 4d 49 44 49 |l after |the MIDI|
|00005b80| 53 69 67 6e 4f 75 74 20 | 63 61 6c 6c 20 68 61 73 |SignOut |call has|
|00005b90| 20 62 65 65 6e 20 6d 61 | 64 65 2c 20 6f 72 20 62 | been ma|de, or b|
|00005ba0| 65 66 6f 72 65 20 4d 49 | 44 49 53 69 67 6e 49 6e |efore MI|DISignIn|
|00005bb0| 20 68 61 73 20 62 65 65 | 6e 20 6d 61 64 65 2c 20 | has bee|n made, |
|00005bc0| 61 72 65 20 53 6e 64 44 | 69 73 70 56 65 72 73 69 |are SndD|ispVersi|
|00005bd0| 6f 6e 20 61 6e 64 20 4d | 49 44 49 53 69 67 6e 49 |on and M|IDISignI|
|00005be0| 6e 2e 0d 4d 49 44 49 47 | 65 74 43 6c 69 65 6e 74 |n..MIDIG|etClient|
|00005bf0| 73 0d 46 75 6e 63 74 69 | 6f 6e 20 4d 49 44 49 47 |s.Functi|on MIDIG|
|00005c00| 65 74 43 6c 69 65 6e 74 | 73 20 3a 20 4d 49 44 49 |etClient|s : MIDI|
|00005c10| 49 44 4c 69 73 74 48 64 | 6c 3b 0d 49 64 69 6f 73 |IDListHd|l;.Idios|
|00005c20| 79 6e 63 72 61 73 69 65 | 73 0d a5 09 74 68 65 20 |yncrasie|s...the |
|00005c30| 63 61 6c 6c 20 69 73 20 | 75 73 75 61 6c 6c 79 20 |call is |usually |
|00005c40| 6d 61 64 65 20 62 79 20 | 70 61 74 63 68 65 72 73 |made by |patchers|
|00005c50| 20 6f 72 20 6f 74 68 65 | 72 20 63 6c 69 65 6e 74 | or othe|r client|
|00005c60| 73 0d 54 68 69 73 20 63 | 61 6c 6c 20 72 65 74 75 |s.This c|all retu|
|00005c70| 72 6e 73 20 61 20 68 61 | 6e 64 6c 65 20 74 6f 20 |rns a ha|ndle to |
|00005c80| 61 20 73 74 72 75 63 74 | 75 72 65 20 63 6f 6e 74 |a struct|ure cont|
|00005c90| 61 69 6e 69 6e 67 20 74 | 68 65 20 20 63 6c 69 65 |aining t|he clie|
|00005ca0| 6e 74 49 44 73 20 6f 66 | 20 61 6c 6c 20 63 6c 69 |ntIDs of| all cli|
|00005cb0| 65 6e 74 73 20 73 69 67 | 6e 65 64 20 69 6e 74 6f |ents sig|ned into|
|00005cc0| 20 74 68 65 20 73 79 73 | 74 65 6d 2e 20 54 68 69 | the sys|tem. Thi|
|00005cd0| 73 20 68 61 6e 64 6c 65 | 20 69 73 20 61 6c 6c 6f |s handle| is allo|
|00005ce0| 63 61 74 65 64 20 69 6e | 20 74 68 65 20 63 61 6c |cated in| the cal|
|00005cf0| 6c 65 72 d5 73 20 68 65 | 61 70 2c 20 61 6e 64 20 |ler.s he|ap, and |
|00005d00| 74 68 65 20 63 61 6c 6c | 65 72 20 69 73 20 72 65 |the call|er is re|
|00005d10| 73 70 6f 6e 73 69 62 6c | 65 20 66 6f 72 20 64 65 |sponsibl|e for de|
|00005d20| 61 6c 6c 6f 63 61 74 69 | 6e 67 20 74 68 65 20 6d |allocati|ng the m|
|00005d30| 65 6d 6f 72 79 2e 0d 54 | 68 65 20 72 65 73 75 6c |emory..T|he resul|
|00005d40| 74 69 6e 67 20 68 61 6e | 64 6c 65 20 77 69 6c 6c |ting han|dle will|
|00005d50| 20 62 65 20 4e 49 4c 20 | 69 66 20 74 68 65 72 65 | be NIL |if there|
|00005d60| 20 77 61 73 20 61 6e 20 | 65 72 72 6f 72 20 69 6e | was an |error in|
|00005d70| 20 61 6c 6c 6f 63 61 74 | 69 6e 67 20 74 68 65 20 | allocat|ing the |
|00005d80| 6d 65 6d 6f 72 79 20 62 | 6c 6f 63 6b 2e 20 0d 44 |memory b|lock. .D|
|00005d90| 61 74 61 20 53 74 72 75 | 63 74 75 72 65 73 3a 0d |ata Stru|ctures:.|
|00005da0| 4d 49 44 49 49 44 4c 69 | 73 74 20 3d 0d 20 20 20 |MIDIIDLi|st =. |
|00005db0| 20 52 45 43 4f 52 44 0d | 20 20 20 20 20 20 20 20 | RECORD.| |
|00005dc0| 6e 75 6d 49 44 73 20 3a | 20 49 4e 54 45 47 45 52 |numIDs :| INTEGER|
|00005dd0| 3b 0d 20 20 20 20 20 20 | 20 20 6c 69 73 74 20 3a |;. | list :|
|00005de0| 20 41 72 72 61 79 20 5b | 30 20 2e 2e 20 6e 75 6d | Array [|0 .. num|
|00005df0| 49 44 73 2d 31 5d 20 6f | 66 20 4f 53 54 79 70 65 |IDs-1] o|f OSType|
|00005e00| 3b 0d 20 20 20 20 45 4e | 44 3b 0d 4d 49 44 49 47 |;. EN|D;.MIDIG|
|00005e10| 65 74 43 6c 69 65 6e 74 | 4e 61 6d 65 0d 50 72 6f |etClient|Name.Pro|
|00005e20| 63 65 64 75 72 65 20 4d | 49 44 49 47 65 74 43 6c |cedure M|IDIGetCl|
|00005e30| 69 65 6e 74 4e 61 6d 65 | 28 63 6c 69 65 6e 74 49 |ientName|(clientI|
|00005e40| 44 3a 4f 53 54 79 70 65 | 3b 0d 56 41 52 20 6e 61 |D:OSType|;.VAR na|
|00005e50| 6d 65 20 3a 20 53 54 52 | 32 35 35 29 3b 0d 49 64 |me : STR|255);.Id|
|00005e60| 69 6f 73 79 6e 63 72 61 | 73 69 65 73 0d a5 09 74 |iosyncra|sies...t|
|00005e70| 68 65 20 63 61 6c 6c 20 | 6d 61 79 20 62 65 20 6d |he call |may be m|
|00005e80| 61 64 65 20 62 79 20 61 | 20 63 6c 69 65 6e 74 0d |ade by a| client.|
|00005e90| a5 09 74 68 65 20 63 61 | 6c 6c 20 69 73 20 75 73 |..the ca|ll is us|
|00005ea0| 75 61 6c 6c 79 20 6d 61 | 64 65 20 62 79 20 70 61 |ually ma|de by pa|
|00005eb0| 74 63 68 65 72 73 20 6f | 72 20 6f 74 68 65 72 20 |tchers o|r other |
|00005ec0| 63 6c 69 65 6e 74 73 0d | 54 68 69 73 20 70 72 6f |clients.|This pro|
|00005ed0| 63 65 64 75 72 65 20 77 | 69 6c 6c 20 72 65 74 75 |cedure w|ill retu|
|00005ee0| 72 6e 20 74 68 65 20 70 | 72 69 6e 74 20 6e 61 6d |rn the p|rint nam|
|00005ef0| 65 20 6f 66 20 63 6c 69 | 65 6e 74 20 69 6e 20 74 |e of cli|ent in t|
|00005f00| 68 65 20 56 41 52 20 70 | 61 72 61 6d 65 74 65 72 |he VAR p|arameter|
|00005f10| 20 6e 61 6d 65 2e 20 54 | 68 65 20 73 74 72 69 6e | name. T|he strin|
|00005f20| 67 20 72 65 74 75 72 6e | 65 64 20 69 73 20 74 68 |g return|ed is th|
|00005f30| 65 20 73 74 72 69 6e 67 | 20 64 69 73 70 6c 61 79 |e string| display|
|00005f40| 65 64 20 62 79 20 74 68 | 65 20 50 61 74 63 68 42 |ed by th|e PatchB|
|00005f50| 61 79 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 61 |ay appli|cation a|
|00005f60| 73 20 74 68 65 20 63 6c | 69 65 6e 74 d5 73 20 6e |s the cl|ient.s n|
|00005f70| 61 6d 65 2e 20 41 20 6e | 75 6c 6c 20 73 74 72 69 |ame. A n|ull stri|
|00005f80| 6e 67 20 77 69 6c 6c 20 | 62 65 20 72 65 74 75 72 |ng will |be retur|
|00005f90| 6e 65 64 20 69 66 20 74 | 68 65 72 65 20 69 73 20 |ned if t|here is |
|00005fa0| 6e 6f 20 6d 61 74 63 68 | 69 6e 67 20 63 6c 69 65 |no match|ing clie|
|00005fb0| 6e 74 2e 0d 4d 49 44 49 | 53 65 74 43 6c 69 65 6e |nt..MIDI|SetClien|
|00005fc0| 74 4e 61 6d 65 20 0d 50 | 72 6f 63 65 64 75 72 65 |tName .P|rocedure|
|00005fd0| 20 4d 49 44 49 53 65 74 | 43 6c 69 65 6e 74 4e 61 | MIDISet|ClientNa|
|00005fe0| 6d 65 20 28 63 6c 69 65 | 6e 74 49 44 3a 20 4f 53 |me (clie|ntID: OS|
|00005ff0| 54 79 70 65 3b 0d 6e 61 | 6d 65 3a 20 53 54 52 32 |Type;.na|me: STR2|
|00006000| 35 35 29 3b 0d 49 64 69 | 6f 73 79 6e 63 72 61 73 |55);.Idi|osyncras|
|00006010| 69 65 73 0d a5 09 74 68 | 65 20 63 61 6c 6c 20 6d |ies...th|e call m|
|00006020| 61 79 20 62 65 20 6d 61 | 64 65 20 62 79 20 61 20 |ay be ma|de by a |
|00006030| 63 6c 69 65 6e 74 0d a5 | 09 74 68 65 20 63 61 6c |client..|.the cal|
|00006040| 6c 20 69 73 20 75 73 75 | 61 6c 6c 79 20 6d 61 64 |l is usu|ally mad|
|00006050| 65 20 62 79 20 70 61 74 | 63 68 65 72 73 20 6f 72 |e by pat|chers or|
|00006060| 20 6f 74 68 65 72 20 63 | 6c 69 65 6e 74 73 0d 54 | other c|lients.T|
|00006070| 68 69 73 20 70 72 6f 63 | 65 64 75 72 65 20 77 69 |his proc|edure wi|
|00006080| 6c 6c 20 73 65 74 20 74 | 68 65 20 70 72 69 6e 74 |ll set t|he print|
|00006090| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 63 6c 69 | name of| the cli|
|000060a0| 65 6e 74 20 6d 61 74 63 | 68 69 6e 67 20 63 6c 69 |ent matc|hing cli|
|000060b0| 65 6e 74 49 44 20 74 6f | 20 6e 61 6d 65 2e 20 54 |entID to| name. T|
|000060c0| 68 69 73 20 73 74 72 69 | 6e 67 20 69 73 20 64 69 |his stri|ng is di|
|000060d0| 73 70 6c 61 79 65 64 20 | 61 73 20 74 68 65 20 63 |splayed |as the c|
|000060e0| 6c 69 65 6e 74 d5 73 20 | 6e 61 6d 65 20 69 6e 20 |lient.s |name in |
|000060f0| 74 68 65 20 50 61 74 63 | 68 42 61 79 20 61 70 70 |the Patc|hBay app|
|00006100| 6c 69 63 61 74 69 6f 6e | 2e 20 49 66 20 74 68 65 |lication|. If the|
|00006110| 72 65 20 69 73 20 6e 6f | 20 6d 61 74 63 68 69 6e |re is no| matchin|
|00006120| 67 20 63 6c 69 65 6e 74 | 2c 20 6e 6f 74 68 69 6e |g client|, nothin|
|00006130| 67 20 69 73 20 64 6f 6e | 65 2e 0d 4d 49 44 49 47 |g is don|e..MIDIG|
|00006140| 65 74 50 6f 72 74 73 0d | 46 75 6e 63 74 69 6f 6e |etPorts.|Function|
|00006150| 20 4d 49 44 49 47 65 74 | 50 6f 72 74 73 28 63 6c | MIDIGet|Ports(cl|
|00006160| 69 65 6e 74 49 44 3a 20 | 4f 53 54 79 70 65 29 20 |ientID: |OSType) |
|00006170| 3a 20 4d 49 44 49 49 44 | 4c 69 73 74 48 64 6c 3b |: MIDIID|ListHdl;|
|00006180| 0d 49 64 69 6f 73 79 6e | 63 72 61 73 69 65 73 0d |.Idiosyn|crasies.|
|00006190| a5 09 74 68 65 20 63 61 | 6c 6c 20 6d 61 79 20 62 |..the ca|ll may b|
|000061a0| 65 20 6d 61 64 65 20 62 | 79 20 61 20 63 6c 69 65 |e made b|y a clie|
|000061b0| 6e 74 0d a5 09 74 68 65 | 20 63 61 6c 6c 20 69 73 |nt...the| call is|
|000061c0| 20 75 73 75 61 6c 6c 79 | 20 6d 61 64 65 20 62 79 | usually| made by|
|000061d0| 20 70 61 74 63 68 65 72 | 73 20 6f 72 20 6f 74 68 | patcher|s or oth|
|000061e0| 65 72 20 63 6c 69 65 6e | 74 73 0d 54 68 69 73 20 |er clien|ts.This |
|000061f0| 63 61 6c 6c 20 77 69 6c | 6c 20 72 65 74 75 72 6e |call wil|l return|
|00006200| 20 61 20 68 61 6e 64 6c | 65 20 74 6f 20 61 20 73 | a handl|e to a s|
|00006210| 74 72 75 63 74 75 72 65 | 20 63 6f 6e 74 61 69 6e |tructure| contain|
|00006220| 69 6e 67 20 74 68 65 20 | 70 6f 72 74 49 44 73 20 |ing the |portIDs |
|00006230| 6f 66 20 61 6c 6c 20 70 | 6f 72 74 73 20 73 69 67 |of all p|orts sig|
|00006240| 6e 65 64 20 69 6e 74 6f | 20 74 68 65 20 73 79 73 |ned into| the sys|
|00006250| 74 65 6d 20 74 68 61 74 | 20 62 65 6c 6f 6e 67 20 |tem that| belong |
|00006260| 74 6f 20 74 68 65 20 63 | 6c 69 65 6e 74 20 77 68 |to the c|lient wh|
|00006270| 6f 73 65 20 69 64 65 6e | 74 69 66 69 65 72 20 69 |ose iden|tifier i|
|00006280| 73 20 63 6c 69 65 6e 74 | 49 44 2e 20 54 68 69 73 |s client|ID. This|
|00006290| 20 68 61 6e 64 6c 65 20 | 69 73 20 61 6c 6c 6f 63 | handle |is alloc|
|000062a0| 61 74 65 64 20 69 6e 20 | 74 68 65 20 63 61 6c 6c |ated in |the call|
|000062b0| 65 72 d5 73 20 68 65 61 | 70 2c 20 61 6e 64 20 74 |er.s hea|p, and t|
|000062c0| 68 65 20 63 61 6c 6c 65 | 72 20 69 73 20 72 65 73 |he calle|r is res|
|000062d0| 70 6f 6e 73 69 62 6c 65 | 20 66 6f 72 20 64 65 61 |ponsible| for dea|
|000062e0| 6c 6c 6f 63 61 74 69 6e | 67 20 74 68 65 20 6d 65 |llocatin|g the me|
|000062f0| 6d 6f 72 79 2e 0d 44 61 | 74 61 20 53 74 72 75 63 |mory..Da|ta Struc|
|00006300| 74 75 72 65 73 3a 0d 4d | 49 44 49 49 44 4c 69 73 |tures:.M|IDIIDLis|
|00006310| 74 20 3d 0d 20 20 20 20 | 52 45 43 4f 52 44 0d 20 |t =. |RECORD. |
|00006320| 20 20 20 20 20 20 20 20 | 20 6e 75 6d 49 44 73 20 | | numIDs |
|00006330| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 20 20 20 20 20 |: INTEGE|R;. |
|00006340| 20 20 20 20 20 6c 69 73 | 74 20 3a 20 41 72 72 61 | lis|t : Arra|
|00006350| 79 20 5b 30 20 2e 2e 20 | 6e 75 6d 49 44 73 5d 20 |y [0 .. |numIDs] |
|00006360| 6f 66 20 4f 53 54 79 70 | 65 3b 0d 20 20 20 20 45 |of OSTyp|e;. E|
|00006370| 4e 44 3b 0d 4d 49 44 49 | 41 64 64 50 6f 72 74 0d |ND;.MIDI|AddPort.|
|00006380| 46 75 6e 63 74 69 6f 6e | 20 4d 49 44 49 41 64 64 |Function| MIDIAdd|
|00006390| 50 6f 72 74 28 63 6c 69 | 65 6e 74 49 44 3a 20 4f |Port(cli|entID: O|
|000063a0| 53 54 79 70 65 3b 0d 62 | 75 66 53 69 7a 65 3a 20 |SType;.b|ufSize: |
|000063b0| 49 4e 54 45 47 45 52 3b | 0d 56 41 52 20 72 65 66 |INTEGER;|.VAR ref|
|000063c0| 6e 75 6d 3a 20 49 4e 54 | 45 47 45 52 3b 0d 69 6e |num: INT|EGER;.in|
|000063d0| 69 74 3a 20 4d 49 44 49 | 50 6f 72 74 50 61 72 61 |it: MIDI|PortPara|
|000063e0| 6d 73 50 74 72 29 20 3a | 20 4f 53 45 72 72 3b 0d |msPtr) :| OSErr;.|
|000063f0| 49 64 69 6f 73 79 6e 63 | 72 61 73 69 65 73 0d a5 |Idiosync|rasies..|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.